Getting the UPDATEd value and its primary key

I have two procedures, proc1 and proc2.
In proc1 there is an update happening like
CREATE OR REPLACE procedure proc1
as
TYPE NumList IS TABLE OF employees.employee_id%TYPE;
enums NumList;
TYPE NameList IS TABLE OF employees.last_name%TYPE;
names NameList;
BEGIN
UPDATE emp set sal=900 WHERE department_id = 30
RETURNING employee_id, last_name BULK COLLECT INTO enums, names;
DBMS_OUTPUT.PUT_LINE('Updated ' || SQL%ROWCOUNT || ' rows:');
FOR i IN enums.FIRST .. enums.LAST
LOOP
DBMS_OUTPUT.PUT_LINE('Employee #' || enums(i) || ': ' || names(i));
END LOOP;
END;
/In proc2 which is getting executed just after proc2 i want to SELECT the sal column values and its primary keys(employee_id) which got updated in proc 1.
How can i achieve this?

add two out parameters from proc1 so that you can pass them into proc2 (obv. you'd need to add two in parameters to proc2 if they aren't there already)

Similar Messages

  • How to get the kerning value and set it to back use script?

    hi,guys
    I come back again.
    I encountered a kerning problem.
    how to get the kerning value and set it to back use script?
    Thanks very much!

    For both cases, the filename can be found on the FILE.ReceivedFileName Context Property.  You can access this Property in a Pipeline Component or Orchestration and take any action you want, such as apply to a database.
    The value is accessed by: MyReceivedMessage(FILE.ReceivedFileName)
    In the case of a duplicate EDI Interchange, you would use the Failed Message Routing feature to capture the error message with either an Orchestration or Send Port.

  • I just purchased harry potter and the deathly hallows digital copy but i just synced my ipod and its not there. i went back to get the copy again and its sasy the cose can only be used once. I dont have the movie and now i cant get it at all.

    I just purchased harry potter and the deathly hallows digital copy but i just synced my ipod and its not there. i went back to get the copy again and its says the code can only be used once. I dont have the movie and now i cant get it at all. i paid for it when i bought the movie but now i dont own it at all. i feel cheated, somebody please help!

    Not Charge
    - See:      
    iPod touch: Hardware troubleshooting
    iPhone and iPod touch: Charging the battery
    - Try another cable. Some 5G iPods were shipped with Lightning cable that were either initially defective or failed after short use.
    - Try another charging source
    - Inspect the dock connector on the iPod for bent or missing contacts, foreign material, corroded contacts, broken, missing or cracked plastic.
    - Make an appointment at the Genius Bar of an Apple store.
      Apple Retail Store - Genius Bar 

  • When we run query how it gets the characteristic values and attributes.

    Hi,
    When we load transaction data it chacks characteristic values then SIDs then DIM IDs then insert  DIM IDs into fact table but when we run the query how it checks and gets the characteristic values and attributes.
    Bye
    GK

    when we run the query how it checks and gets the characteristic values and attributes.
    Just the opposite way you have described. It gets from the corresponding masterdata tables, with the connected SID.

  • Peoplecode to get dropdownlist box value and its description

    Hi,
    I have assigned a value and its description to dropdownlist box. when try to get the value and description in somewhere, i didn't get the description. i got only the value of the current row in a rowset. but i want to fetch the description which i assigned to the dropdownlist for the corresponding value. Is there any way to get the description?

    Since it is not a XLAT bound to the field, you cannot use the field class properties.
    What is the source of the dropdownlist?
    If it comes from a database record, you could fetch the description from the database using the &Field.Value as input.
    But this would cause a lot of database roundtrips.
    You could store the value and description in a two dimensional component array variable and load this array with the values and descriptions at PostBuild Event.
    This will only fires ones during the component build.
    Suppose the values are "hardcoded", something like this
    /* Create component 2-dim array */
    Component array of array of string &DropdownArray;
    &DropdownArray = CreateArrayRept("", 0);
    &DropdownArray.Push(CreateArray("value1", "descr1");
    &DropdownArray.Push(CreateArray("value2", "descr2");
    &DropdownArray.Push(CreateArray("value3", "descr3");
    After this populate the dropdownlist with values and descriptions from the array.
    For &i = 1 To &DropdownArray.Len
      &Field.AddDropDownItem(&DropdownArray[&i][1], &DropdownArray[&i][2]);
    End-For;
    Whenever you need to fetch the description of the dropdownlist value, first find the value by &Field.Value and then search within the array for the description.
    /*Get value from dropdown */
    &Value = &Field.Value;
    /*Find index for value*/
    &Ind = &DropdownArray.Find(&Value);
    /*Get description (second index in subarray)*/
    &Descr = &DropdownArray [&Ind][2];
    I am writing the code without an environment, so typos could exist
    Hope this helps.

  • I have to ctrl+f5 to force refresh the site in order to get the updated page, and that happens with all the sites (news, sport....etc), Why?

    if i open cnn.com for the first time today and try to open it tomorrow i will get the yesterday news and not the updated one till i force refresh..and that with all the site

    Start Firefox in [[Safe Mode]] to check if one of the add-ons is causing the problem (switch to the DEFAULT theme: Tools > Add-ons > Themes).
    * Don't make any changes on the Safe mode start window.
    See:
    * [[Troubleshooting extensions and themes]]
    * [[Troubleshooting plugins]]

  • Getting the Month value and Name from the Ranges of the Date given input.

    Hi Techies,
    I am developing Monthly wise report in FICO. My Inputs are Company Code, Fiscal Year and Date Range. From the Date Range I have to get the month and Generate the Report.
    For Ex:
    BUKRS : 1000
    GJAHR : 2009
    FKDAT : 01.04.2008 to 01.04.2009
    From the Above Date range how can I get the individual month names or periods. As per my Knowledge I can get the month value when the date is parameter but here the date is ranges.  Is any code available for this ?
    Thanks in Advance
    Regards,
    Muralikrishna Peravali.
    Edited by: muralipsharma on Aug 31, 2010 10:30 AM
    Edited by: muralipsharma on Aug 31, 2010 12:57 PM

    DATA: lv_dat          TYPE dats,
          lv_day          TYPE c LENGTH 2,
          lv_month        TYPE c LENGTH 2,
          lv_year         TYPE c LENGTH 4.
    DATA: lv_poper        TYPE t009b-poper.
    DATA: lt_poper        TYPE TABLE OF t009b-poper.
    SELECT-OPTIONS: so_dat        FOR sy-datum.
    break fis-kemmer.
    lv_dat = so_dat-low.
    DO.
      CLEAR: lv_poper.
      CALL FUNCTION 'FI_PERIOD_DETERMINE'
        EXPORTING
          i_budat        = lv_dat
        IMPORTING
          e_poper        = lv_poper
        EXCEPTIONS
          fiscal_year    = 1
          period         = 2
          period_version = 3
          posting_period = 4
          special_period = 5
          version        = 6
          posting_date   = 7
          OTHERS         = 8.
      APPEND lv_poper TO lt_poper.
      lv_day    = lv_dat+6(2).
      lv_month  = lv_dat+4(2).
      lv_year   = lv_dat(4).
      lv_month = lv_month + 1.
      IF lv_month LE 9.
        CONCATENATE '0' lv_month INTO lv_month.
      ENDIF.
      CONCATENATE lv_year lv_month lv_day INTO lv_dat.
      IF lv_dat GT so_dat-high.
        EXIT.
      ENDIF.
    ENDDO.
    after that you have a list of all the FI periods in internal table LT_POPER.
    get the idea?

  • ON UPDATE CASCADE and Autoincrement primary key with Oracle SQL Developer

    hello everybody,
    I want to know if Oracle SQL Developer manage autoincrement on primary key and "ON UPDATE CASCADE" when i migrate (with data) SQL Server database in Oracle database.
    Can you help me ?
    Thanks for your suggestions.

    Obtain the value of the auto increment key with the getGeneratedKeys() method.
    Statement stmt = null;
    ResultSet rs = null;
    stmt = conn.createStatement(java.sql.ResultSet.TYPE_FORWARD_ONLY,
                                    java.sql.ResultSet.CONCUR_UPDATABLE);
    stmt.executeUpdate("DROP TABLE IF EXISTS autoIncTable");
        stmt.executeUpdate(
                "CREATE TABLE autoIncTable ("
                + "priKey INT NOT NULL AUTO_INCREMENT, "
                + "dataField VARCHAR(64), PRIMARY KEY (priKey))");
    stmt.executeUpdate(
                "INSERT INTO autoIncTable  (dataField) "
                + "values ('data field value')",
                Statement.RETURN_GENERATED_KEYS);
    int autoIncKeyFromApi = -1;
        rs = stmt.getGeneratedKeys();
        if (rs.next()) {
            autoIncKeyFromApi = rs.getInt(1);
        } else {
        rs.close();

  • Problem while inserting the same value on a primary key column

    hi all ,
    in my application there is a block with a pat_id column "primary key" ,
    if the user inserts the same value in this column , a message appears asking me if i want to save the changes or not ,
    i do not know what changes is the message asking about , and sure i do not want this message to appear to the user
    when he insert the same values by mistake ?
    thanks

    as a primary key field dont fill this with manually try use db seq.
    Use pre-insert trigger .

  • I continually get the Update message and when I click it runs and never completes update. This has happened everytime I log in.

    Whenever I log in on my computer, I get a Firefox Update message and when I click on it it continually runs for hours and never completes the update.

    If you have problems with updating or with the permissions then easiest is to download the full version and trash the currently installed version to do a clean install of the new version.
    Download a new copy of the Firefox program and save the DMG file to the desktop
    * Firefox 4.0.x: http://www.mozilla.com/en-US/firefox/all.html
    * Firefox 3.6.x: http://www.mozilla.com/en-US/firefox/all-older.html
    * Trash the current Firefox application to do a clean (re-)install
    * Install the new version that you have downloaded
    Your profile data is stored elsewhere in the [http://kb.mozillazine.org/Profile_folder_-_Firefox Firefox Profile Folder], so you won't lose your bookmarks and other personal data.

  • Changing a field value to its primary key (i.esupplier_name to supplier_id)

    Hi,
    I have an insert function which takes data from two tables (table1, table2) and inserts it into another(table3). I've had to add an extra field to the destination table for the supplier_id. However, one source table has supplier_id but the other one uses supplier_name.
    How can i programmically change the supplier_name to supplier_id during the insert process (obviously there is a supplier table with supplier_id and supplier_name in it, which somehow i need to link to).
    Many thanks

    Hi anthony
    Can you understand the question..if yes, can you
    explain me.It means something like...
    SQL> select * from supplier1;
    SUPPLIER_ID SUPP        VAL
              1 Bob          10
              2 Fred         54
              3 Jim          11
    SQL> select * from supplier2;
    SUPP        VAL
    Bob          15
    Fred         24
    Jim          13
    SQL> desc supplier3;
    Name                                                                     Null?    Type
    SUPPLIER_ID                                                                       NUMBER
    SUPPLIER_NAME                                                                     VARCHAR2(10)
    VAL1                                                                              NUMBER
    VAL2                                                                              NUMBER
    SQL> ed
    Wrote file afiedt.buf
      1  insert into supplier3
      2  select s1.supplier_id, s1.supplier_name, s1.val, s2.val
      3  from supplier1 s1, supplier2 s2
      4* where s1.supplier_name = s2.supplier_name
    SQL> /
    3 rows created.
    SQL> select * from supplier3;
    SUPPLIER_ID SUPPLIER_N       VAL1       VAL2
              1 Bob                10         15
              2 Fred               54         24
              3 Jim                11         13
    SQL>Although it depends if the OP wants to combine the rows as I've done here or union the rows as Anthony was showing.
    Essentially though the point of the OP's problem was joining the two tables to get the supplier_id, which is obviously done via the name or some other common unique attribute.

  • OS 10.6.7 imac Itunes library can't be seen by imovie, iphoto or idvd though all can see iphotos. Apple tech had me reinstall imovie, iphoto and get the updates again and itunes library still not seen by rest of ilife '11 suite.

    I have tried everything I saw in the forums but can't make iLife '11 apps see itunes library.  Apple had me delete existing files for iphoto and imovie including the apps themselves and reinstall from the disks that came with my imac last month.  This did not work.  Itunes Library still not found by any of the iLife apps though they can see iphoto movies and photos.  Is this really the way it is or is there a solution?   I tried to install iLife Support 904 but it wouldn't install past the selection of install location; at that point the install button was grayed out.  Update Software insists all software is up to date.  Please help if you know the answer. 

    I have the exact same issue.  Apple also directed me to do the same tasks... didn't correct the issue.  We can not be the only ones with this issue.I can't add music from iTunes to any slideshows, iDVD's or anything.  I have rebuilt my itunes Library as directed by Apple... no progress.

  • Get the parameter values and entire call stack in procedure

    Does Oracle provides any utility procedure like format_error_stack, and format_call_stack, where I can get entire procedure/function call along with parameters passed to it so that I can just dump that into some table as part of logging.
    -S

    Thanks for the response. I guess who_am_i and who_called_me gives only the proc/function name. I am looking for a way to figure out what was the parameters and values passed to the procedure so I can simply dump them into my log tables.
    This would be similar to any java application where it can dump its own call stack, which has parameters and values passed to it and can dump into a log file.
    For ex:
    create or replace procedure my_proc( a number, b varchar2)
    is
    begin
    --this log stack should be able to print procedure name and parameters passed to it.
    -- I should be able to use log_stack without any parameters in any procedure/function
    log_stack();
    end;
    --My output should be something like this
    SQL> EXEC my_proc(1, 'ABC')
    CALL STACK:
    my_proc(a => 1, b => 'ABC')

  • How can I get the default value of a particular preference programatically. I know I can see the default value for some of the preferences in about:config but, I need a programatic way to get the default value.

    <blockquote>Locked by Moderator as a duplicate/re-post.
    Please continue the discussion in this thread: [tiki-view_forum_thread.php?comments_parentId=702631&forumId=1]
    Thanks - c</blockquote>
    == Issue
    ==
    I have a problem with my bookmarks, cookies, history or settings
    == Description
    ==
    How can I get the default value of a particular preference in FireFox?.
    I know I can see the default value for some of the preferences in about:config but, I need a programatic way to get the default value.
    I see some that there are values for preferences in firefox.cs but I am not certain that these are being used as the default values for preferences. prefs.js in user's profile only has the updated values and not the default values.
    Any help towards acheiving this programtically is greatly appreciated.
    If the default values are stored in a file, kindly let me know the format in which it is stored for me to parse it programatically.
    == User Agent
    ==
    Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Win64; x64; Trident/4.0; .NET CLR 2.0.50727; SLCC2; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0)

    Dear Friend,
    Here when you have the callableSattement as ?=proc(?), the first ? is an output parameter. So you should register it as out parameter using registeroutparameter.
    Then you can get the value from the outparameter using callablestatement.getXXX().
    Try that way.
    For free tral versions of JDBC Drivers go to www.Atinav.com

  • How to refresh VO to get the changed value in other AM or backend database

    one VO is refrenced by two AMs, when i insert or update data by VO in one AM, how to get the changed data in another AM ?
    another case is i have updated some attributes of the record in database by SQL statement ,but the client can not get the updated value at once .
    i have tried to use executeQuery() ,but it does not work. now i always do a rollback method ,a bad idea.:)
    pls help me ! thanks
    Message was edited by:
    Guo Qinghua

    Mind that ADF BC (probably like any other persistence framework) caches data. So when you update something in the database other than via ADF BC, you then have in the ADF BC cache what is called 'stale data'. When you try to commit that nevertheless, the database will tell ADF BC that the record in the database has been updated by another user, and a rollback will be done. That is all to be expected.
    You can find some more info on how this works here:
    http://download-uk.oracle.com/docs/html/B25947_01/bcvoeo007.htm
    It also explains how to clear the cache and enforce that data will be read from the database.
    Jan Kettenis

Maybe you are looking for