Update in select

is it possible to update a table from select statement?

there can be scenarios where you need to update the
record conditinally.....in that case you can't make
use of SQL.....In general, you can. That's why we have CASE. Admittedly, at some point, you're willing to trade the performance for the SQL solution for the readability of the PL/SQL solution. It's just important to realize that you're making the trade-off and that you understand the performance you're giving up.
the example that i gave just to show how it
works..!!!I agree that your example shows how to use the WHERE CURRENT OF syntax. My point was that this doesn't strictly answer the questions that have been asked. It answers what we're guessing someone has misheard an interview question to be, which is always a dangerous thing. It's entirely possible that the actual question is something totally different.
Justin

Similar Messages

  • Cant' update while select is active in read-committed mode

    Hi All
    I try to execute my java program the following error is comming
    "cant' update while select is active in read-committed mode"
    I am using prepraredStatement. The query is running successfully in QueryTool or Toad. But the Error is coming while execute this line
    "stmt.executeUpdate(); "
    pleaes solve my problem..
    Thankx

    <br>Mmm, it seems same question Re: insert data problem</br>
    <br>Nicolas.</br>

  • Sessions/connections gets hang during update and select operations.

    A table with 3 million records, which has customer details data.
    Everyday application is executing select and update queries on that table.
    Sessions/connections gets hang during update and select operations.
    After checking ADDM report, following are the findings:
    Please suggest the solutions
    Findings and Recommendations
    Finding 1: Row Lock Waits
    Impact is 145.22 active sessions, 99.77% of total activity.
    SQL statements were found waiting for row lock waits.
    Recommendation 1: Application Analysis
    Estimated benefit is 145.22 active sessions, 99.77% of total activity.
    Action
    Significant row contention was detected in the TABLE
    "AVAYA.AIRTEL_CUSTOMER_MASTER" with object ID 82155. Trace the cause of
    row contention in the application logic using the given blocked SQL.
    Related Object
    Database object with ID 82155.
    Rationale
    The SQL statement with SQL_ID "974vg65j29pmv" was blocked on row locks.
    Related Object
    SQL statement with SQL_ID 974vg65j29pmv.
    UPDATE AVAYA.AIRTEL_CUSTOMER_MASTER SET PREFERRED_LANGUAGE = :1
    WHERE ( AIRTEL_CUSTOMER_MASTER.MSISDN = :2 )
    Rationale
    The session with ID 50 and serial number 34525 in instance number 1 was
    the blocking session responsible for 100% of this recommendation's
    benefit.
    Symptoms That Led to the Finding:
    Wait class "Application" was consuming significant database time.
    Impact is 145.22 active sessions, 99.77% of total activity.
    Finding 2: Top SQL Statements
    Impact is 46.39 active sessions, 31.87% of total activity.
    SQL statements consuming significant database time were found. These
    statements offer a good opportunity for performance improvement.
    Recommendation 1: SQL Tuning
    Estimated benefit is 46.39 active sessions, 31.87% of total activity.
    Action
    Investigate the UPDATE statement with SQL_ID "974vg65j29pmv" for
    possible performance improvements. You can supplement the information
    given here with an ASH report for this SQL_ID.
    Related Object
    SQL statement with SQL_ID 974vg65j29pmv.
    UPDATE AVAYA.AIRTEL_CUSTOMER_MASTER SET PREFERRED_LANGUAGE = :1
    WHERE ( AIRTEL_CUSTOMER_MASTER.MSISDN = :2 )
    Rationale
    The SQL spent only 0% of its database time on CPU, I/O and Cluster
    waits. Therefore, the SQL Tuning Advisor is not applicable in this case.
    Look at performance data for the SQL to find potential improvements.
    Rationale
    Database time for this SQL was divided as follows: 100% for SQL
    execution, 0% for parsing, 0% for PL/SQL execution and 0% for Java
    execution.
    Rationale
    SQL statement with SQL_ID "974vg65j29pmv" was executed 212 times and had
    an average elapsed time of 2494 seconds.
    Rationale
    Waiting for event "enq: TX - row lock contention" in wait class
    "Application" accounted for 100% of the database time spent in
    processing the SQL statement with SQL_ID "974vg65j29pmv".

    **addm report **
              ADDM Report for Task 'TASK_7526'
    Analysis Period
    AWR snapshot range from 5003 to 5004.
    Time period starts at 08-JUL-13 11.00.27 AM
    Time period ends at 08-JUL-13 12.00.45 PM
    Analysis Target
    Database 'AVAYADB' with DB ID 2878789264.
    Database version 11.2.0.1.0.
    ADDM performed an analysis of instance avayadb, numbered 1 and hosted at
    NG-LA04AVAYA01.
    Activity During the Analysis Period
    Total database time was 563062 seconds.
    The average number of active sessions was 155.63.
    Summary of Findings
       Description         Active Sessions      Recommendations
                           Percent of Activity
    1  Row Lock Waits      155.44 | 99.88       1
    2  Top SQL Statements  26.67 | 17.14        1
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
              Findings and Recommendations
    Finding 1: Row Lock Waits
    Impact is 155.4 active sessions, 99.88% of total activity.
    SQL statements were found waiting for row lock waits.
       Recommendation 1: Application Analysis
       Estimated benefit is 155.44 active sessions, 99.88% of total activity.
       Action
          Significant row contention was detected in the TABLE
          "AVAYA.AIRTEL_CUSTOMER_MASTER" with object ID 82155. Trace the cause of
          row contention in the application logic using the given blocked SQL.
          Related Object
             Database object with ID 82155.
       Rationale
          The SQL statement with SQL_ID "974vg65j29pmv" was blocked on row locks.
          Related Object
             SQL statement with SQL_ID 974vg65j29pmv.
             UPDATE AVAYA.AIRTEL_CUSTOMER_MASTER SET PREFERRED_LANGUAGE = :1
             WHERE  ( AIRTEL_CUSTOMER_MASTER.MSISDN = :2 )
       Rationale
          The session with ID 167 and serial number 6084 in instance number 1 was
          the blocking session responsible for 100% of this recommendation's
          benefit.
       Symptoms That Led to the Finding:
          Wait class "Application" was consuming significant database time.
          Impact is 155.45 active sessions, 99.88% of total activity.
    Finding 2: Top SQL Statements
    Impact is 26.66 active sessions, 17.14% of total activity.
    SQL statements consuming significant database time were found. These
    statements offer a good opportunity for performance improvement.
       Recommendation 1: SQL Tuning
       Estimated benefit is 26.67 active sessions, 17.14% of total activity.
       Action
          Investigate the UPDATE statement with SQL_ID "974vg65j29pmv" for
          possible performance improvements. You can supplement the information
          given here with an ASH report for this SQL_ID.
          Related Object
             SQL statement with SQL_ID 974vg65j29pmv.
             UPDATE AVAYA.AIRTEL_CUSTOMER_MASTER SET PREFERRED_LANGUAGE = :1
             WHERE  ( AIRTEL_CUSTOMER_MASTER.MSISDN = :2 )
       Rationale
          The SQL spent only 0% of its database time on CPU, I/O and Cluster
          waits. Therefore, the SQL Tuning Advisor is not applicable in this case.
          Look at performance data for the SQL to find potential improvements.
       Rationale
          Database time for this SQL was divided as follows: 100% for SQL
          execution, 0% for parsing, 0% for PL/SQL execution and 0% for Java
          execution.
       Rationale
          SQL statement with SQL_ID "974vg65j29pmv" was executed 707 times and had
          an average elapsed time of 794 seconds.
       Rationale
          Waiting for event "enq: TX - row lock contention" in wait class
          "Application" accounted for 100% of the database time spent in
          processing the SQL statement with SQL_ID "974vg65j29pmv".
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
              Additional Information
    Miscellaneous Information
    Wait class "Commit" was not consuming significant database time.
    Wait class "Concurrency" was not consuming significant database time.
    Wait class "Configuration" was not consuming significant database time.
    Wait class "Network" was not consuming significant database time.
    Wait class "User I/O" was not consuming significant database time.
    Session connect and disconnect calls were not consuming significant database
    time.
    Hard parsing of SQL statements was not consuming significant database time.

  • Can't update while select is active in read-committed mode

    Hi
    This is my business logic:
    I m selecting the values from three tables by UNION ALL and i m geting the record set in while loop at the same time i try to insert the values which is getting from select statement in the First Table in the same while loop.
    my problem is when i try to insert into the same table the following error is occured
    "can't update while select is active in read-committed mode"
    Now what can i do ? please give me ur solution ...
    Thankx
    Merlina

    depending on how many values you have, you could store the results in memory, a vector or similar collection.
    Then close the select statement, and insert the values from your vector into the table.... should work then.
    Or, there may be a way of creating an updatable resultset ?
    This question is better directed at the
    "Java Database Connectivity (JDBC) & Transactions (JTA/JTS)" section of the forum. Maybe post a questions there, ensuring you give the URL of this question here too to avoid cross-posting.
    regards,
    Owen

  • BOP Results update only selected by check box.

    Hi Folks,
    Please help me in finding the solution.
    I have ran the Back Order Processing for a perticular material with post processing option selected using /sapapo/bop transaction.
    in the second step I want to update a few selected orders using trx /sapapo/bop_result. there it will display all the results with check box.
    my requirement is to update only selected(check box) orders.
    Points for sure.

    Hi Srinivas,
    I don't think there is way to update selected order from BOP results. I tried scenario in our system but when you hit Update button it will process all the order.
    I also refered SAP Help but it not clearly mention about that.
    In the point 5 in SAP help it says "You can update or reject the results entirely afterwards"
    http://help.sap.com/saphelp_scm50/helpdata/en/26/c2d63b18bc7e7fe10000000a114084/frameset.htm
    I hope this helps.
    Regards,
    Harshil Desai

  • My iphone keeps freezing, especially in the mail setting.  The support center indicates i should go to settings, then general settings, and  then to update software, but there is no "update software" selection under general settings.  can anyone help?

    My iphone keeps freezing, especially in the mail setting.  The support center indicates i should go to settings, then general settings, and  then to update software, but there is no "update software" selection under general settings.  can anyone help?  Thanks!
    PS  i think I have an iphone4, but not sure

    You may connect it to iTunes and update it from there.

  • [svn] 1263: Update language selection code so that you can actually select one of the new languages I recently added .

    Revision: 1263
    Author: [email protected]
    Date: 2008-04-16 12:25:02 -0700 (Wed, 16 Apr 2008)
    Log Message:
    Update language selection code so that you can actually select one of the new languages I recently added.
    Modified Paths:
    flex/sdk/trunk/modules/asc/src/java/macromedia/asc/util/Context.java
    flex/sdk/trunk/modules/asc/src/java/macromedia/asc/util/ContextStatics.java

    Revision: 1263
    Author: [email protected]
    Date: 2008-04-16 12:25:02 -0700 (Wed, 16 Apr 2008)
    Log Message:
    Update language selection code so that you can actually select one of the new languages I recently added.
    Modified Paths:
    flex/sdk/trunk/modules/asc/src/java/macromedia/asc/util/Context.java
    flex/sdk/trunk/modules/asc/src/java/macromedia/asc/util/ContextStatics.java

  • A recent Photoshop CC update now selects the wrong video adapter and disables 3d

    My asus laptop has an ivy bridge processor with included HD graphics and an NVIDIA 650M Graphics Adapter.  Until i recently updated Photoshop CC, i was able to do 3d without issue in Photoshop as the 650M has 2 GB of video ram.  Since the update, Phtoshop selects the Intel HD4000 which only has 32 MB of video ram, so 3d is disabled. 
    I've tried the bios, even though all i did was update photoshop, and there is not setting for default.
    I'm running win 7 home premium,8 GB memory

    We have released a new update(14.1.1) for Photoshop CC, please update to the latest and let us know it ot solves your issue.
    See the following thread for more info on the update:
    http://forums.adobe.com/message/5674936#5674936
    Regards
    Pragya

  • Insert, update and select Chinese characters

    Dear all,
    I fail to use my application to insert, update or select Chinese characters into Oracle DB using oracle instant client 9i. Do I need to do to setup for NLS_LANG?
    My OS is WIN 2K prof.
    Regards,
    Kenneth

    Set the environment variable NLS_LANG to include the correct value for the Chinese codepage that you want.
    Does the problem go away?
    Yours,
    Laurenz Albe

  • Update while selecting

    Is there any way in oracle where we update while selecting.
    I have a situation where I select a few rows from a table.
    Then I have to update those all those rows witrh some date as sysdate.
    I want to make sure that the rows I have selected are only updated and not a single new one.
    ex:
    select
    process something.
    update table set filed=sysdate where pk_col in (select --it is the same as 1st select );
    but in real time,
    when i select 1st time i get 40 rows.
    I process them.
    now i have to update just those 40 rows,
    but this time when I say
    update (select --its a second read.... this time select gives me 42 rows)
    maybe someone was working and he updated the table and I got 2 more rows.
    But as i processed 40, i want to update only 40 rows.
    So how can i be sure.
    Any ideas. please help.
    1 solution is to have a cursor and do the processing and updaing in the cursor.
    I process 40 rows and i update only those 40 rows in the cursor.
    other way, update when i select. i it possible.
    please let me know.
    meenakshi

    Hi.
    Check this please:
    CREATE TABLE aux_d
         id NUMBER,
         d_date DATE
    INSERT INTO aux_d VALUES(1,null);
    INSERT INTO aux_d VALUES(2,null);
    INSERT INTO aux_d VALUES(3,null);
    COMMIT;
    SELECT * FROM aux_d;
    ID     D_DATE
    1     (null)
    2     (null)
    3     (null)
    UPDATE
      SELECT *
      FROM aux_d
      WHERE id < 3
    SET d_date = SYSDATE;
    COMMIT;
    SELECT * FROM aux_d;
    ID     D_DATE
    1     14/07/11
    2     14/07/11
    3     (null)Hope this helps.
    Regards.

  • Date field not updated when select on F4 value on editable ALV Grid

    Can some one look into this to see what was wrong.
    I have a report that display fields extracted from a ZTable and display on an ALV Editable Grid.
    The data are displayed as read only mode for these fields:
    Field A -   type char20 and have a search help available.
    Start Date - type dats
    End Date - type dats.
    Field B
    Field C ...
    When user select to add new record,  Field A, Start Date and End Date must be editable, the rest are read only.
    On field A because there is search help available, I have no problem select data on F4 pull down menu and the data is updated on the grid.
    But on field start date and end date, there is F4 menu and when you pull down, it shows the calendar date.  But when I select the date to change, it acts like nothing happens.  I run the debug mode and found out that in function module 'F4IF_FIELD_VALUE_REQUEST', after you select the date field, I got the return code irc = 8 from line 305 of this FM.
    Here is what I did.
    I build field catalog similar like BCALV_EDIT04  (add table type lvc_t_styl to each extracted record to indicate which field will be  editable.
    In the PBO,  I build field catalog and set style as enable for these fields:
    CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
        EXPORTING
          i_structure_name = p_struct
        CHANGING
          ct_fieldcat      = p_t_fieldcat.
    LOOP AT p_t_fieldcat INTO ls_fcat.
        CASE   ls_fcat-fieldname.
           when 'Field_A'.
               ls_fcat-ref_table = 'ZTABNAME'.
            ls_fcat-ref_field = 'FIELD_A'.
            ls_fcat-edit = 'X'.
            MODIFY p_t_fieldcat FROM ls_fcat.
       when 'START_DATE' or 'END_DATE'.
        ls_fcat-style = CL_GUI_ALV_GRID=>MC_STYLE_enabled.
             MODIFY p_t_fieldcat FROM ls_fcat.
       endcase.
    Just curious, I copied program BCALV_EDIT_08 to ZBCALV_EDIT08 and make field booking date as editable to test.  When I select to change booking date from F4 menu pull down, the new date is populated to the screen field.  So what was wrong between my program and BCALV_EDIT_08?  Thanks for your help.  I am stuck on this problem for 2 days and could not figure out what was wrong.

    not sure why you use that FM for date filed , you just need in the field catalog make sure that are use a date field of reference , anyway check program BCALV_EDIT_01

  • Get OLD&NEW value of an UPDATED column selected dynamically in a Trigger

    Hi All,
    I am writting a trigger which take column name dynamically. And on the basis of that column it should give me old value as well as updated value of a column corresponding to a modified row.
    OOO_SCHEDULE is my table name;
    Note: This is only for test so I am writting only for update not for insert and delete.
    create or replace trigger "OOO_SCHEDULE_AUDIT"
    BEFORE
    insert or update or delete on "OOO_SCHEDULE"
    for each row
    begin
    DECLARE
    v_username varchar2(30);
    AUDIT_EMP_ID varchar2(30);
    AUDIT_EMP_ID_NEW varchar2(30);
    v_Column_name VARCHAR(30);
    v_stmt1 VARCHAR(40);
    v_stmt2 VARCHAR(40);
    CURSOR C1 is
    select COLUMN_NAME from user_tab_columns where table_name='OOO_SCHEDULE';
    BEGIN
    OPEN c1;
    LOOP
    FETCH c1 into v_Column_name;
    EXIT WHEN c1%NOTFOUND;
    v_stmt1:=('OLD.'||v_Column_name);
    v_stmt2:=('NEW.'||v_Column_name);
    AUDIT_EMP_ID:=v_stmt1;
    AUDIT_EMP_ID_NEW:=v_stmt2;
    INSERT INTO TEMPTEST VALUES(v_stmt1);
    INSERT INTO TEMPTEST VALUES(AUDIT_EMP_ID);
    END LOOP;
    CLOSE c1;
    END;
    end;
    Suppose OOO_EMP_NAME is the column name where user made the change.
    If i do like this..
    AUDIT_EMP_ID:=OLD.OOO_EMP_NAME;
    AUDIT_EMP_ID_NEW:=NEW.OOO_EMP_NAME;
    Then it is working fine because I have given column name statically. But I want the column name to be selected dynamically and I am able to do it through cursor. Also I am able to fetch all column names in v_Column_name variable one by one dyanamically for the cursor.
    But by executing these statements
    AUDIT_EMP_ID:=v_stmt1;
    AUDIT_EMP_ID_NEW:=v_stmt2;
    I am getting OLD.OOO_EMP_NAME and NEW.OOO_EMP_NAME rather then old and new values of the updated column.
    Please help me identifying the problem, where I am doing the mistake? What is the correct way to execute these statements? So that I can get old and new values of the column (updated column).
    I have tried it by passing in a procedure also but don't know how to execute this dynamic statement to get the old and new values.
    Thanks,
    Ishrat.

    In the given link, column name has been selected statically. But i want that column name should be selected daynamically throgh loop and then check the
    condition for any update corresponding to that column value. I don't want to write as many if condition as the no. of column name. I just want one if condition for all column namesDon't be lazy. Write all column names into your trigger. Or use a way to create the trigger "dynamically".
    What is the problem that you have with static column names? "I don't want to write many..." is not a problem, but an opinion.

  • Mass Updating of Selected Rows

    (As you can see from my low number of posts I'm new to ApEx, so any information you can provide is appreciated.)
    Hi,
    I've been asked to include what I consider a heavy duty feature on a report. It has been requested that there is a form region above a report region. The form will have some fields on it to be used to mass update selected rows.
    For instance, let's say the report is a list of employees and their dept and the form has a dropdown dept field that contains a list of depts. They want to be able to select certain employees on the report, then select a dept from the form and then click an Update Rows button. They want the selected rows to be updated with the selected dept. * Also, they don't want the report to be editable. * The only way to update any rows is thru the Update Row button.
    I'm new to ApEx and can code in JavaScript, but am not an expert in either. And, I'm still trying to figure out what JavaScript syntax works in Element Attributes, etc. fields. But, I digress.
    I have looked over several threads, and went to several demo pages, and have learned some things. Hopefully they are correct. If not, please correct me.
    - Using the Row Selector is tricky.
    - You can get the Row Selector on a regular SQL report by changing it to Updateable SQL, adding the Row Selector type, and changing it back.
    - You can only see row information on a column if the column is editable.
    I now have a report that is NOT editable and has NO editable columns. And the report has the Row Selector. Also, the ID (key) of each row is the first column of each row. (It's a link field that populates another page.) With the ID I can populate the correct record. I'm thinking I need to populate the ID again in another column into a text field and then be able to access that value on the selected rows.
    Here's my dilemma. (That is, if I'm on the right track.) I need to know which rows are selected and then access the ID (key value) of that row. After that I can let my PL/SQL do the work.
    - - 1. How does the 2nd ID need to be defined such that people can't edit it, but the value can be retrieved? And, how is this done? I assume something can be put in the Element Attributes. If so, will you please provide the code?
    - - 2. What is the trick to knowing which rows are selected? An example snippet of code would be great here too.
    - - 3. Also, tell me if I'm on the wrong track and need to provide a solution in a different way.
    Sorry for the novel, but I wanted you to have a good idea of what I'm trying to accomplish so you may provide appropriate answers.
    Thanks much, Tony

    Hi Tony,
    check out the following threads:
    Re: Reference a value within a report????
    Re: MRU - trying to restrict UPDATE to only certain users - everyone INSERT
    BTW, you don't have to use any JavaScript. When you write your "Update pl/sql process" for the tabular form, just reference you page item which contains the department for your mass update.
    eg.
    FOR ii IN 1 .. Apex_Application.g_f01.COUNT
    LOOP
        UPDATE EMPLOYEES
          SET DEPARTMENT_ID = :P4_NEW_DEPARTMENT_ID
        WHERE EMPLOYEE_ID   = Apex_Application.g_f02(Apex_Application.g_f01(ii))
    END LOOP;Hope that gives you a direction how to solve that
    Patrick
    Check out my APEX-blog: http://inside-apex.blogspot.com
    Check out the ApexLib Framework: http://apexlib.sourceforge.net

  • Updated Report Selection Criteria doesn't show in Publication

    Hi,
    This is my first post in this forum and I'm relatively new to Crystal Reports Server.
    We have Crystal Reports Server 2008 V1 SP3.
    I have two independent reports that I've put together in a report publication. The report is saved to the file system.
    I made a change to one of the report's selection criteria. I viewed the report thru the Crystal Reports Program and Infoview/CMC to confirm the additional records I wanted showing were showing. They were and everything worked.
    A week went by and I noticed that the saved report didn't have the additional records.
    I've contacted SAP support and we were able to get everything working by doing the following
    1) Remove the updated report from the publication's Source Documents list. Save and Close
    2) Re-add the report to the publication's Source Documents list.
    3) Delete the old recurring schedule (so we don't have two instances doing the same thing).
    4) Re-create a new schedule for the delivery (not reschedule and replace an existing nor reschedule and create new, but a brand new one).
    These changes were compounded by the fact that I had 4 different scheduled instances, each with a different parameters, so these 4 steps were actually closer to 8.
    In my own testing I was able to confirm something similar happens with a single report (not part of a publication) when you change the selection criteria. I had to create a new scheduled delivery in order to get the selection criteria change to flow thru.
    My questions to all you is
    Is there some other way to distribute 2 reports in way that making a change the criteria of the report doesn't require doing anything else?
    Thanks.
    Edited by: David Steven on Feb 13, 2012 9:58 PM

    Hi RobbinsFam!
    Here is an article that describes the issue you are seeing, and can provide you with some helpful troubleshooting steps:
    iOS: Unable to import photos to computer
    http://support.apple.com/kb/ts3195
    Thanks for coming to the Apple Support Communities!
    Cheers,
    Braden

  • JDBC Receiver adapter ( INSERT/UPDATE with SELECT)

    Is it possible to have following kind of SQL Statement comming out JDBC Receiver Adatpter. If yes what would be the corresponding XML Document format for this.
    UPDATE suppliers 
    SET supplier_name = ( SELECT customers.name
    FROM customers
    WHERE customers.customer_id = suppliers.supplier_id)
    This condition also needs to be applied for Insert condition. Any pointer would be useful.
    Thanks,
    Samir

    Hi
    Refer this links,
    http://help.sap.com/saphelp_nw04/helpdata/en/22/b4d13b633f7748b4d34f3191529946/frameset.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/b0/676b3c255b1475e10000000a114084/frameset.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/2e/96fd3f2d14e869e10000000a155106/frameset.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/4d/8c103e05df2e4b95cbcc68fed61705/frameset.htm
    Regards,
    Suryanaryana

  • Hint in Update or Select Statement in an inline query ??

    Hi ,
    I had an update statement that will get the data from the inline select statement,now where can i can keep the hint ,either in update statement or in Select statement...
    Please let me know if my sample script is wrong or any better way to approach...Please assume that Salary table had millions of employee's salary records.
    update emp
    set salary = salary + (select /*+ full(a) parallel(a,4)  */ salary from Salary
                             where   experience > 5  and empno = 55 )
    where empno = 85Thanks
    Rede

    You would put the hint in the select statement as you have it, but it won't work until you alias your table name to "a" since that is how you are referencing it in the hint:
    update emp
    set salary = salary + (select /*+ full(a) parallel(a,4)  */ salary from Salary a
                             where   experience > 5  and empno = 55 )
    where empno = 85
    NOTE I added the "a" right after the Salary table name AND you can only do parallel updates on partitioned table, but the select will run in parallel to at least get the data for you quickly.
    To answer your other question about syntax, it is incorrect and there are a lot of ways to write it but a straight forward way would be to use the merge statement
    merge into emp e
    using (select /*+ full(s) parallel(s,4)  */ s.salary from salary s where s.experience > 5) s
    on (e.empno = s.empno)
    when matched then update
    set salary = s.salary;

Maybe you are looking for

  • SQL Timeouts and Blocking Locks

    SQL Timeouts and Blocking Locks Just wanted to check in and see if anyone here has feedback on application settings, ColdFusion settings, JBOSS settings or other settings that could help to limit or remove SQL Timeouts and blocking locks on SID's. We

  • How do I clean the fans on my 2011 macbook pro 13inch

    I have a early 2011 macbook pro 13 inch. It travels with me every where I go. I have had the computer almost three months now and have not had a problem with it.  Some how, debris got in to the fans. I am thinking it some how got sucked in to one of

  • 1.4 Web Browser auto-search doesn't work on wifi only

    This issue only started in 1.4 and it's a bit weird. If I'm in the web browser, at the start page and I type something and hit "enter" or choose google (they both ssearch on google) it will either run forever without ever loading google or take a VER

  • How to run servlet inside jar file

    Hi I have a problem on running a servlet class which resides in a jar file. At first, it runs if it is located in the root directory of jar file, but if I put in inside a sub directory, I wasn't able to run it. It seems that the servlet class was not

  • Javascript interrupting responsive design

    I added javascript to my website which is great and the site is still response but I have to reload the page to see the website change to the proportions. Obviously this is no good from a design point of view as the website will look terrible if you