Hi i want to use boolean type in a procedure as out parameter !!

Hi
I need to use Boolean type as out parameter in my procedure which return true if the SELECT query in procedure returns any row otherwise it should return false
please HELP !!

I need to use Boolean type as out parameter in my procedure which return true if the SELECT query in procedure returns any row otherwise it should return false
Sounds like basic PL/SQL stuff.
What problem are you experiencing?
Are you looking for something like this?
create or replace procedure check_emp (p_empno in number, p_result out boolean) is
  dummy  pls_integer;
begin
  select 1
  into dummy
  from scott.emp
  where empno = p_empno;
  p_result := true;
exception
  when no_data_found then
    p_result := false;
end;
SQL> declare
  2    emp_exists  boolean;
  3  begin
  4    check_emp(7839, emp_exists);
  5    if emp_exists then
  6      dbms_output.put_line('Employee exists');
  7    else
  8      dbms_output.put_line('Employee does not exist');
  9    end if;
10  end;
11  /
Employee exists
PL/SQL procedure successfully completed

Similar Messages

  • Want to use transaction type

    Hi,
      Enter another transaction type (Transaction type . does not exist)
    Message no. AA816
    Diagnosis
    According to your entry or specification, you want to use transaction type .. However, this transaction type has not been defined.
    Procedure
    Check the if transaction type . is defined in FI-AA Customizing.

    wat are u trying to do? nature of transaction?
    which transaction code are u using? and
    which transaction type u used?

  • PCR Social security: want to use wage type amount in decision operation

    PCR Social Security: Want to use wage type amount for comparison  
    Posted: Oct 21, 2010 11:00 AM                                  Reply
    Dear Guru's,
    hope u'll b fine and enjoying good health. Below is PCR for social security that I hav currently configured. Its working fine. However I have another scenario to add in this PCR.
    Existing PCR works on the following logic
    6% of Gross pay if employee's pay less than or equal to 10,000/-.
    KZPESI=10000 from T511K
    KZMESI=6 from T511K
    IZPESI=600 from T511P
    Now i want to add another comparison. also calculate Social security for employee those hire on pay less than or equal to 10,000 but currently have salary greater than 10K. for this I'll enter Social security amount in IT0014 subtype 6004. I
    ZSSM Personnal Calculation Rule ZSSM
    3
    6004 Social security Contrib
    AMT= 0001 Set
    AMT+ 0002 Addition
    AMT+ 0003 Addition
    AMT+ 0004 Addition
    AMT+ 1001 Addition
    ROUNDGK100 Round AMT to next
    AMT?KZPESI Comparison
    <
    AMT*KZMESI Multiplication
    AMT/100 Division
    RTE=TKSOLL Set
    RTE-TKAU** Subtraction
    ROUNDGK100 Round AMT to next
    ADDWT * OT Output table
    =
    AMT/TKDIVI Division
    RTE=TKSOLL Set
    RTE=TKAU** Set
    MULTI ARA Multipl.amt/no/rate
    AMT=IZPESI Set
    ROUNDGK100 Round AMT to next
    ADDWT * OT Output table
    >
    if there is a value in 0014 subtype 6004 then
    AMT/TKDIVI Division
    RTE=TKSOLL Set
    RTE=TKAU** Set
    MULTI ARA Multipl.amt/no/rate
    AMT=IZPESI Set
    ROUNDGK100 Round AMT to next
    ADDWT * OT Output table
    Want to know how I can use wage type amount in comparison. look at the above lines in bold where i want to apply
    kindly help
    Edited by: Imran on Oct 21, 2010 11:40 AM

    You say "if there is a value in 0014 subtype 6004 then...", so I will assume that you are talking of WT 6004 in Infotype 0014.
    So, in a PCR immediately after IT0014 is processed (with function P0014 in your schema), look for WT 6004.  If it exists with a number (or an amount), create a temporary variable to act as a "flag"  (as in ADDWT&6004 or ADDWT&HIRE).
    Then, in PCR ZSSM, you can query that temporary variable with the sequence of operations NUM=& HIRE NUM?0 (or NUM=& 6004 NUM?0 ). If the return value is =, it means that there was no IT0014 with WT 6004, and if the return value is * it means that there was.

  • PCR Social Security: Want to use wage type amount for comparison

    Dear Guru's,
    hope u'll b fine and enjoying good health.  Below is PCR for social security that I hav currently configured. Its working fine. However I have another scenario to add in this PCR. 
    Existing PCR works on the following logic
    6% of Gross pay if employee's pay less than or equal to 10,000/-.
    KZPESI=10000 from T511K
    KZMESI=6        from T511K
    IZPESI=600      from T511P
    Now i want to add another comparison. also calculate Social security for employee those hire on pay less than or equal to 10,000 but currently have salary greater than 10K. for this I'll enter Social security amount in IT0014 subtype 6004.  I
    ZSSM Personnal Calculation Rule ZSSM
        3
          6004 Social security Contrib
            AMT=  0001 Set
            AMT+  0002 Addition
            AMT+  0003 Addition
            AMT+  0004 Addition
            AMT+  1001 Addition
            ROUNDGK100 Round AMT to next
            AMT?KZPESI Comparison
              <
                AMT*KZMESI Multiplication
                AMT/100    Division
                RTE=TKSOLL Set
                RTE-TKAU** Subtraction
                ROUNDGK100 Round AMT to next
                ADDWT *    OT   Output table
              =
                AMT/TKDIVI Division
                RTE=TKSOLL Set
                RTE=TKAU** Set
                MULTI ARA  Multipl.amt/no/rate
                AMT=IZPESI Set
                ROUNDGK100 Round AMT to next
                ADDWT *    OT   Output table
            >
              if there is a value in 0014 subtype 6004 then
                      AMT/TKDIVI Division
                       RTE=TKSOLL Set
                       RTE=TKAU** Set
                       MULTI ARA  Multipl.amt/no/rate
                      AMT=IZPESI Set
                      ROUNDGK100 Round AMT to next
                      ADDWT *    OT   Output table
      Want to know how I can use wage type amount in comparison. look at the above lines in bold where i want to apply
    kindly help
    Edited by: Imran on Oct 21, 2010 11:40 AM

    KZPESI=10000 from T511K
    KZMESI=6 from T511K
    IZPESI=600 from T511P
    Social security wage type is 6004 and it is subtype of 0014.
    ZSSM Personnal Calculation Rule ZSSM
    3
    6004 Social security Contrib
    AMT= 0001 Set
    AMT+ 0002 Addition
    AMT+ 0003 Addition
    AMT+ 0004 Addition
    AMT+ 1001 Addition
    ROUNDGK100 Round AMT to next
    AMT?KZPESI Comparison
    >
    At this point I want to set another comparison based on amount in 6004.
    if Amount in 6004 is > 0 then
       do calculation.
    hope it'll b more clear now

  • Using Row Type in Stored Procedure

    Hi,
    I am working on ADF technology wherein I need to call Procedure from javacode.
    I am using Jdev 11g version.
    I am using Entity Impl to invoke my Stored Procedure which I have used Row Type in it.
    This procedure is running Independently using Toad. But I am not able to call it from Java code.
    For EX: We will call the Stored Proc from Java code in this way.
    String stmt = "begin execute_define_deliverables(?,?,?,?); end;";
    st.setInt(1,this.XXXXX.intValue());
    if(this.getXXXX()!=null)
    st.setString(2,this.getXXXXXX());
    else
    st.setNull(2,Types.VARCHAR);
    Whereas the questionmarks indicates the individual columns.
    But My problem is I have used Row Type in my Stored Proc.
    Any pointers in this regard will be very helpful.
    Regards,
    Kalyan

    Hi Satya,
    Now I got it, thanks,
    Can you please advise, if I use the same stored procedure for EMP Table and use my array values to retrieve the selected EMPNo
    I tried following but I could not succeed.
    When I compile the stored procedure, error occurs:
    "inconsistent datatypes: expected NUMBER got NUM_ARRAY"
    for example:
    CREATE TYPE NUM_ARRAY AS TABLE OF NUMBER;
    Create or Replace Package TB_Data
    Is Type CV_Type Is REF CURSOR;
    END TB_DATA;
    Create or Replace Stored Procedure give_me_an_array
    (CV IN OUT TB_DATA.CV_TYPE,
    MEmpNo In Num_Array)
    Is
    Begin
    Open CV for
    Select * from EMP
    Where Empno in MEmpNo;
    End myProc;
    declare
    mdata num_array:=num_array(7839,7844);
    begin
    give_me_an_array(mdata);
    end;
    Best Regards,
    Luqman

  • I no longer want to use Gmail-How do I get it out of my life?

    While I have read entries in Apple support communities and Mac forums I have never actually participated so I'm not sure how to go about it.
    Any  guidance would be appreciated.
    When I got this computer Apple helped me set it up with GMail. I don't remember how. I just know when I click on the postage stamp Gmail open's up.
    I always found it confusing and it seemed to never do what I wanted it to. I have another Email account and want to get rid of GMail (It keeps grabbing
    the mail from the account I want to keep!)  I just haven't been able to figure out how.  Please help! By-the-way I am not very computer literate so please
    make any directions plain and as simple as possible. Any help I can get would be very much appreciated.

    mail app > prefrences> accounts> select the gmail you dont want by clicking on it once> hit the minus "--" button and it will be off your mac computer

  • While selecting clips I want to use in my video the audio goes out...

    I recorded a 10 minute video and to edit I basically click and drag my mouse over the part of the clip I want. Usually when I've clicked and am dragging my mouse I can hear what I'm saying so I know when to stop. Well lately I've been dragging my mouse and I cannot hear what I'm saying. If I close down iMovie and open it back up it works again but that is getting really annoying.
    Can anyone help? Thanks.

    The first thing to check would be to make sure you have "Aidio Skimming" turned on.
    View menu>second from bottom.

  • HT204053 i had an iphone that i cancelled and now have an ipad, and want to use the old address? Is this out of the question?

    My husband has a new ipad and prev had an iphone, how do we use the old apple id

    The apple ID can refer to either the iTunes store or iCloud accounts. I'll assume you mean iCloud. Go to Settings>iCloud. Scroll to bottom of page and enter your ID and password for iCloud.

  • HT5621 I have changed my apple ID....now how do I change the apple ID on my Ipad that it wants to use for login...its greyed out so impossible to change..

    I have changed my Apple ID...now how do I change the default apple ID on my Ipad....the apple ID is greyed out so cant change it...

    Tap on the id in Settings > iTunes & App Store and tap 'sign out' on the popup and then log back in with the updated version - if that is also greyed out then check to see if you currently have Settings > General > Restrictions > Accounts (under the 'allow changes' heading) set to 'Don't Allow Changes'

  • How to execute a procedure if out parameter is table type

    Hi,
    I need to execute a procedure, output parameter of the procedure is table type.
    Oracle version I am using is 9.2.0.8 . I am using SQL*Plus
    Procedure declaration
    PROCEDURE current_open_cycle (p_ban IN repl_cust2.billing_account.ban%TYPE,
    v_bill_seq_rec OUT bill_seq_table) ;
    Table type declaration
    TYPE bill_seq_table IS
    TABLE OF bill_seq_rectype INDEX BY BINARY_INTEGER ;
    TYPE bill_seq_rectype IS RECORD (v_cycle_run_year repl_cust2.bill.cycle_run_year%TYPE,
    v_cycle_run_month repl_cust2.bill.cycle_run_month%TYPE,
    v_cycle_code repl_cust2.bill.cycle_code%TYPE,
    v_open_cycle BOOLEAN, -- An open cycle
    v_billed_cycle BOOLEAN, --
    v_invoice_number VARCHAR2(13),
    v_start_date DATE,
    v_end_date DATE,
    v_root_ban repl_cust2.bill.root_ban%TYPE) ;
    I tried executing using this script, but it failed. When I execute this oracle lost connection to data base.
    declare
    r_bill_seq_rec ss_invoice_utilities.bill_seq_table;
    begin
    ss_invoice_utilities.current_open_cycle(934018003,r_bill_seq_rec);
    end;
    Please help me how I should write declare block to execute this procedure and also print output of the procedure.
    Regards
    Raghu

    I don't see anything wrong with the anonymous block, assuming ss_invoice_utilities is the correct package name. Perhaps a simplified test case would show up what's not working there.
    As for printing the contents of an associative array, you'll have to write some code to loop through it and construct a string per row to output via dbms_output, assuming the text will fit within dbms_output's size restrictions in 9i. dbms_output is a debugging tool though - is that the requirement?
    btw "pls_integer" is less to type than "binary_integer" ;)
    Edited by: William Robertson on Apr 16, 2009 8:35 AM

  • How to use two types of fonts in a richtextdocument

    hello,
           i want to print a barcode and some text into  a richtextdocument
    example:
    this.richTextBox1.AppendText("\n");
    Font f1 = new Font("3 of 9 Barcode", 50);
    this.richTextBox1.Font = f1;
    this.richTextBox1.AppendText("*1234554*");
    Font f2 = new Font("Arial", 20);
    this.richTextBox1.Font = f2;
    this.richTextBox1.AppendText("fooo");
    but it always uses the second one?
    how can i resolve this?
    i want to use two types of fonts in the same rich text document.
    thank you very much!!

    Select some text and then set the SelectionFont property for each selection, e.g.:
    this.richTextBox1.AppendText("\n");
    this.richTextBox1.AppendText("*1234554*");
    richTextBox1.SelectionStart = 1;
    richTextBox1.SelectionLength = 9; //End of first word
    richTextBox1.SelectionFont = new System.Drawing.Font("Tahoma", 10);
    this.richTextBox1.AppendText("fooo");
    richTextBox1.SelectionStart = 10;
    richTextBox1.SelectionLength = 4;
    richTextBox1.SelectionFont = new System.Drawing.Font("Arial", 20);
    Please remember to close your threads by marking helpful posts as answer and then start a new thread if you have a new question.

  • How to use true type font in smartform with ECC6

    hi,expert:
    I want to use true type font "Comic Sans MS.ttf".
    I upload this font file by SE73 named ZTT2I.
    In SE73.. select the Radio button "Font Families" And click on the "True type Font Installation" button. click the font attribute ITALIC。
    Our print device is LP01 and driver is CNSAPWIN
    when I create a new style in smartform using the font ZTT, in preview window the font still like other font.
    Our system is ECC6, SAP_BASIS 700 level0017 packeg SAPKB70017
    how can I solve this problem?
    thaks a lot

    the ABAP forum administrator take this question to netweaver forum.
    Now when I create smartfrom in language EN,it can output correct style of that font.
    But if the smartform is base on language ZH, the output is not correct.
    why? How to solve it?
    thanks a lot

  • Retro entires in HR Forms are not printed when using device type ZHPP3005

    Hi All,
    We are doing a HCM implementation. We are using HP P3005n printer and ZHPP3005 device type to print our HR forms. We are using ZCalibri font.These are smartforms. Everything was printing perfectly.
    Then there were retro calculations made to these forms.Strangely, the forms doesn't display these retro entries in the print preview using ZHPP3005 device type. Only the retro entries throughout the form are not printing. All other entries get printed.
    When we use device type HPLJIIID, we get these retro entries printed in our form however the format of the form gets changed.
    Now, we want to use device type ZHPP3005 and get these retro entries printed. How would we achieve this? Is this a device type issue? Or, anything needs to be done in the smartform? Why is this issue?
    Please help. Quick response will be appreciated. We are nearing our Go Live date and needs this resolved immediately.
    Thanks in Advance.

    Hi,
    Check the assigned page format to your custom device type. Try to assign all the page format which are available for
    HP*** which you gives you desired result.
    Regards,
    Vamshi.

  • HT3406 i have the phone 5c but want to use it like an iPod

    hello i have the iphone 5c but want to use it like an ipod touch with out the sim

    Karhmen wrote:
    Thank you for your very helpful and useful comment and obsersvation.
    I am pleased to advise that I found an answer to my question on another forum.
    Perhaps you would post your answer here so others with the same issue (whatever it may be) may see your answer.

  • Using Copy statement in Stored procedure

    The following statement works in sqlplus session:
    copy from comment/password@servername append amcomment_temp using
    select * from amcomment
    where commentid in(1,2,3,4)
    I want to use this in a stored procedure. There is a long datatype in this table. The
    procedure will not compile. Have tried execute immediate and compiler rejects this statement also.

    'COPY' is a SQL*Plus command, not PL/SQL. This is why the PL/SQL compiler throws it out.

Maybe you are looking for

  • Sudden Loss of Power... but computer works fine...

    I've had my dual 1.8 for about three years now... it's not in the category of G5's that had the power recall. I have it hooked to a Belkin UPS backup, but for the last week or so, the computer will abruptly lose power. I haven't installed any new app

  • Triggering output type when sales order is saved

    Hello all,             I have a small question. Whenever I create a drop ship sales order it triggers a custom output type and prints the form by default even though this output type hasnt been saved in the sales order messages. Similarly from a drop

  • Quicktime sound but no video

    I have sound but no video with my newly updated quicktime 7. How do I troubleshoot this. I tried reloading the software.

  • Vendor code

    dear all, In SAP material code should be maximum of 40 characters. I wanted to add vendor code with that particular material due to which character range goes to 70 digits. do we have a provision to add vendor's material code in material master and a

  • How do I clear out my iTunes...?

    I have an 11 inch macbook air laptop. I am trying to clear out some 34gigs of movies/itunes I have stored on the hard drive. I have 2 full TV seasons that I add to weekly, and want to be able to save those episodes. I am running out of space on the 1