Sql statement not working with for update

Hi, iam facing an error fetch out of sequence
when iam trying to execute a sql statement
Statement st=con.createStatement();
st.executeQuery(select mycolumn from table where jobno=1 for update);
the statement works well without " for update ".
any solutions????

Hi,
The fetch out of sequence error occurs usually when you are trying to read from a cursor that has no data left(like EOF).
After executing the sql statement move the pointer to the first row (or the beginning of the resultset)
This is actually an oracle error bearing number :ORA:01002
Hope this helps.
Thanks,
Creator Team.

Similar Messages

  • Working with FOR UPDATE

    Hi,
    i have 2 session(A, B) and trying to execute sql statement with For update clause
    Session A
    select * from emp where empid in (10) for update nowait;
    Session B
    select * from emp where empid in (10, 20) for update nowait;
    my question is after executing select statement in sessin B will oracle locks
    empid =20 or it will ignore the lock as part of it (empid=10) is already locked by
    session A.
    Can anyone plz help me in this..
    Rds,
    Naga

    Why not try it out?:
    Session A:
    SQL> select empno,ename from emp where empno in (7788) for update nowait;
         EMPNO ENAME
          7788 SCOTTSession B:
    SQL> select * from emp where empno in (7788,7900) for update nowait;
    select * from emp where empno in (7788,7900) for update nowait
    ERROR at line 1:
    ORA-00054: resource busy and acquire with NOWAIT specifiedSesson A again:
    SQL> select empno,ename from emp where empno in (7900) for update nowait;
         EMPNO ENAME
          7900 JAMES

  • DVD player does not work with latest update

    I installed the latest update 10.8.2 and now my brand new Superdrive will not work with new MacBook Pro Retina display.  When I plug in Superdrive and try to start a DVD, it say "DVD quit unexpectedly......"   Took to Apple store and they said it was latest update.  Anyone else with this problem?

    Dear all,
    Perhaps you found out yourselves but the latest Software Update, called OS X Mountain Lion 10.8.2 Supplemental Update, solves this issue. I recommend you install it and restart your Mac.
    When you insert a DVD in the drive and DVD Player launches, you will be prompted to confirm the region encoding (1, 2, 3, 4 or 5, based on the encoding of the DVD you are about to play). This is normal, and you should confirm it again, even if you did it previously.
    Naturally, if most of your DVDs are encoded for one region and you want to play a disc encoded for another region, please remember you may make a limited number of region changes when you play other DVDs, and the last one will be permanent. So, act with caution and sensibility.
    Alessandro

  • Sender JDBC adapter -- Update SQL statement NOT work for the last record

    I'm trying to use SAP XI to send records from Oracle database to As/400 using JDBC adapter.  I've defined the communication channel for sender
    (1)  The "Query SQL statement"  = select  a_bgn_dt,  a_end_dt from  PX_PXXD WHERE NOT CU_ACTION_CD='P' 
    (2)   The "Update SQL statement"  = update PX_PXXD set CU_ACTION_CD='P'  WHERE NOT CU_ACTION_CD='P' 
    Supposed that 3 records were retrieved from (1) and successfully updated to AS/400 but only the first 2 records in Oracle database are updated according to (2)
    Any advise.
    Pansy

    Hi Pansy,
    You select and update query is looking like wrong
    kindly check below query,If you are using oracle
    (1) The "Query SQL statement" = select a_bgn_dt, a_end_dt from PX_PXXD WHERE CU_ACTION_CD !='P'
    (2) The "Update SQL statement" = update PX_PXXD set CU_ACTION_CD='P' WHERE  CU_ACTION_CD !='P'
    Thank you
    Sateesh

  • Keyboard repeating not working with latest update for mac?

    I just updated my Macbook Pro with a new version of Yosemite and i have come to find that the keyboard repeating function is not working anymore, even with the command: defaults write -g ApplePressAndHoldEnabled -bool false
    in terminal.
    Is there anyway to resolve this? I find the other character extremely annoying that they always pop up
    thank you!

    The repeating function you want has been off by default since 10.7 was released 3 years ago.  That terminal command should normally do the trick.  Did you logout and login again?

  • SQL statement not working for an application

    Hello,
    Here is a sql statement which i am using to populate Department ID using another row in the table. Using these I am getting the values called department alias from different table and schema.
    UPDATE tablename_4127 PT
    SET "Deptid" = (select distinct(deptid) from datastore.get_department_alias
    where upper(ltrim(rtrim(deptalias))) = upper(ltrim(rtrim(PT."Dept Descr")))
    AND "Colid" = PT.COLID)
    Please anyone help me with this.
    Thank you

    HBUA wrote:
    Hello,
    Here is a sql statement which i am using to populate Department ID using another row in the table. Using these I am getting the values called department alias from different table and schema.
    UPDATE tablename_4127 PT
    SET "Deptid" = (select distinct(deptid) from datastore.get_department_alias
    where upper(ltrim(rtrim(deptalias))) = upper(ltrim(rtrim(PT."Dept Descr")))
    AND "Colid" = PT.COLID)
    Please anyone help me with this.
    Thank youhelp you how, since we don't have your table, data or requirements?
    How do I ask a question on the forums?
    SQL and PL/SQL FAQ

  • SQL Statement not works using functions or subqueries-MAXDB

    Hello All,
    I created an ABAP program to select information about country(table: T005) with the country names (Table: T005T). I tried to create a sql query with a sql subquery to select everything but for some reason that I don't know it doesn't work. Please find the query below.
    DATA:
    resu        TYPE REF TO cl_sql_result_set ,
    stmt         TYPE REF TO cl_sql_statement ,
    qury        TYPE string .
               qury  = `SELECT land1, spras, `
               &&       `(SELECT landx `
               &&         `FROM SAPNSP.T005T `
               &&         `WHERE mandt = '` && sy-mandt && `' `
               &&           `AND spras = 'EN' `
               &&           `AND land1 = ? ), `
               &&       `(SELECT natio `
               &&         `FROM SAPNSP.T005T `
               &&         `WHERE mandt = '` && sy-mandt && `' `
               &&           `AND spras = 'EN' `
               &&           `AND land1 = ? ) `
               &&        `FROM SAPNSP.T005 `
               &&        `WHERE mandt = '` && sy-mandt && `' `
               &&          `AND land1 = ? `
               &&        `GROUP BY land1, spras` .
    resu = stmt->execute_query( qury ) .
    Well, the query above works but the fields LANDX and NATIO are in blank in ALL THE CASES, even with information registred in table T005T.
    So, exploring the SDN forum and after read some documents regarding ADBC, I create a function to handle this sql select and get the correctly the missing informations, but, still don't work. Please find the function below:
    CREATE FUNCTION select_landx (land1 CHAR(3)) RETURNS CHAR(15)
    AS
      VAR landx CHAR(15);
      DECLARE functionresult CURSOR FOR
      SELECT spras, land1, landx
         FROM SAPNSP.t005t
         WHERE spras = 'EN'
             AND land1 = :land1;
         IF $count IS NULL THEN <- | $count is always 0, my SELECT
           BEGIN                                 it's not work but I don't know why
             CLOSE functionresult;
             RETURN NULL;
           END
         ELSE
           SET $rc = 0;
           WHILE $rc = 0 DO
           BEGIN
             FETCH functionresult INTO :landx;
           END;
         CLOSE functionresult;
         RETURN landx;
    Calling the function in a SQL statement:
    DATA:
    resu        TYPE REF TO cl_sql_result_set ,
    stmt         TYPE REF TO cl_sql_statement ,
    qury        TYPE string .
               qury  = `SELECT land1, spras, select_landx(?) landx `
               &&        `FROM SAPNSP.T005 `
               &&        `WHERE mandt = '` && sy-mandt && `' `
               &&          `AND land1 = ? `
               &&        `GROUP BY land1, spras` .
    resu = stmt->execute_query( qury ) .
    Any comments ?
    Best regards,
    Arthur Silva

    Hello,
    Thank's a lot, it works. It's funny because the given solution works using only abap codes.
    It may be happens because the abap interpretor send the sql statement to the db interface that handle the code in the another way.
    Thanks again, it was driving me crazy.
    Best regards,
    Arthur Silva

  • Playing Slowmotion video over airplay does not work with ios update!!!!!

    after upgrading last ios , airplay to shoot slowmotion video does not work.
    I was expecting it to be fixed with recent update, but still not working!!!
    I use it for education at my clinic - which is essential, and how come apple does not fix it at all?
    or apple should give downgrade option at least.
    FIx it, fix it, fix it!
    Main purpose of puchasing ipad air2 was to airplay slowmotion video to big screen and i  am quite disappointed with my purchsing ipad air 2.

    As the original poster, I too had issues with my iPhone 4 (4.2.1) and Apple TV 2 playing nice. The Airplay icon was visible for music, and worked perfectly. However, when watching a video, purchased through iTunes, only the "audio" option would be selectable for Airplay. After updating the Apple TV software, everything works perfectly well. When watching a video on my iPhone and selecting the Airplay icon, one of the options is to play "video" through the Apple TV, not simply audio.
    It would have been nice to know that my Apple TV needed an update when I updated my iPhone 4 to 4.2.1.

  • My first PL/SQL block not working with using Select query within begin

    I am new to PL/SQL , just started with basics of BLOCKS .
    I am having a query here in executing a block .
    When i am doing a insert oprtation in Blocks Begin method everything is working fine , but when ever i tried to do select operation , some error is being thrown .
    First of all This is my Table :
    select from try :*
    KEY      VALUE
    Key     Value
    Key1     Value1
    Key2     Value2
    Key3     Value3
    ======================
    This is the code which is not working : Please see the code and tell me what is the problem .
    DECLARE
    v_KEY    VARCHAR2(20);
    v_VALUE   VARCHAR2(20);
    BEGIN
    select key into v_KEY FROM try where v_value='Value' ;
    dbms_output.put_line(v_KEY);
    END;
    When i run this code , it is saying Data Not Found on this line " select key into v_KEY FROM try where v_value='Value' ;"
    wheer when i run tis individually it worked fine :
    select KEY FROM try where VALUE='Value' ;"
    please share your ideas .as why it isn't running ??
    Edited by: user10503747 on Sep 20, 2010 3:16 AM

    Hi,
    user10503747 wrote:
    I am new to PL/SQL , just started with basics of BLOCKS .
    I am having a query here in executing a block .
    When i am doing a insert oprtation in Blocks Begin method everything is working fine , but when ever i tried to do select operation , some error is being thrown .
    First of all This is my Table :
    select from try :*
    KEY      VALUE
    Key     Value
    Key1     Value1
    Key2     Value2
    Key3     Value3
    ======================
    This is the code which is not working : Please see the code and tell me what is the problem .
    DECLARE
    v_KEY    VARCHAR2(20);
    v_VALUE   VARCHAR2(20);
    BEGIN
    select key into v_KEY FROM try where v_value='Value' ;
    dbms_output.put_line(v_KEY);
    END;
    When i run this code , it is saying Data Not Found on this line " select key into v_KEY FROM try where v_value='Value' ;"
    wheer when i run tis individually it worked fine :
    select KEY FROM try where VALUE='Value' ;"
    please share your ideas .as why it isn't running ??
    Edited by: user10503747 on Sep 20, 2010 3:16 AMInstead of:
    {code}
    select key into v_KEY FROM try where v_value='Value' ;
    {code}
    perhaps you meant something like:
    {code}
    v_value := 'Value1';
    select key into v_KEY FROM try where v_value=Value ; -- No quotes
    {code}
    Until you assign a vlue to a variable, like v_value, it is NULL, so your original statement was equivalent to
    {code}
    select KEY FROM try where NULL='Value' ;
    {code}
    In PL/SQL, a SELECT ... INTO statement must return exactly one row, or else you will get an error (either NO_DATA_FOUND or TOO_MANY_ROWS). This is different from SQL, where a query cn return any number of rows, including 0, without raising an error.

  • Final cut pro HD 2 not working with new updates

    recently purchased a new imac. Most of my old programs were not supported. I updated to 10.9 from 10.5. Now, all the programs are running except Final Cut pro HD 2. I get a message sayin"power pc applications are no longer supported" Any suggestions? I read in an old discussion (from 2011) that I might need to download Rosetta?

    MichelPM wrote:
    ... or you maybe able to run your version of Final Cut under virtualization software.
    I do not know which version of FCP the OP is using as I do not recognize his designation of Final Cut Pro HD 2.
    However, last weekend I attempted to install Final Cut Studio 2 (Final Cut Pro 6) into Snow Leopard installed in Parallels, as a test.  It failed!
    Final Cut's installer suggested the following problems: not enough VRAM - 64 needed; 0 present (even though Parallels is set for more than the minimum required VRAM); and a missing video card.
    I attempted to work around this problem by using Pacifist to install FCS2, which worked, as far as the installation was completed.  However, when I attemped to run FCS2, a dialog box came up with indicated that same two problems and then it quit.

  • Facetime not working with new update

    I updated my Ipod touch with the new operating system and facetime does not work anymore.
    I didn't update my husbands and his is working fine.
    I checked his options and we have the same set up.
    I even turned off facetime to reactivating it, thinking that it would need to be reactived and there is no difference.
    I tried to back up to the cloud to downgrade it, but it won't show me the status of the cloud, nor will it let me back up to it.
    Any suggestions ?

    Your welcome.
    It will work but you will have to contact your carrier to get a different plan.
    For instance I'm with AT&T on a grandfather plan unlimited data in order for me to use 3G - I will need to update my plan to "shared data plan". 
    I'm not willing to lose my unlimited data, just to use facetime over 3g when it works on wifi.  But that would be up the the user on what they feel is more important.
    Hope that clarifies things.

  • "Do not Disturb" feature is not working with iOS6 update in iPhone4

    I have updated iOS6 on my iphone 4. I tried to turn on "Do not Disturb" feature, schedule time then test it but it is not working. Phone is ringing with vibrate & tone. kindly fix this bug.

    When I first tested the Do Not Disturb function, I discovered two ways it could seem like it was not working. One, as mentioned above, was that my screen was not locked. The other was the settings under Settings/Notifications/Do Not Disturb. If your settings allow calls from favorites and then you try to test the feature from a phone in your favorites list, it will not block the call. Similarly, if you are testing multiple times and the allow repeated call option is set, the call will also get through.
    And one other observation. All of the material I have seen describes the action of the Do Not Disturb function as silencing the notifications. For incoming calls it does more than that; it actually rejects the call so the caller goes straight to voicemail rather than just ringing silently.

  • Case statement Not working with Oracle version 10g

    Below is code , which works on 11r2 but not on 10g.
    declare
    v1 VARCHAR2(200);
    begin
    select version into v1 from DBA_REGISTRY WHERE COMP_NAME LIKE '%Catalog Views%';
    CASE
          WHEN v1 like '10.2%' THEN
    DBMS_OUTPUT.PUT_LINE('it is  10.2');
    dbms_streams_auth.grant_admin_privilege('GGADMIN');
          WHEN v1 like '11.1%' THEN
    DBMS_OUTPUT.PUT_LINE('it is  11.1');
    dbms_streams_auth.grant_admin_privilege('GGADMIN');
    EXECUTE IMMEDIATE 'grant become user to GGADMIN';
          WHEN v1 like '11.2.0.3%' THEN
    DBMS_OUTPUT.PUT_LINE('it is  11.2.0.3');
    dbms_goldengate_auth.grant_admin_privilege('GGADMIN');
        END CASE;
    end;
    /I dont know when i run code in 10.2 it still looks for dbms_goldengate_auth
    and error out.
    dbms_goldengate_auth.grant_admin_privilege('GGADMIN');
    ERROR at line 18:
    ORA-06550: line 18, column 1:
    PLS-00201: identifier 'DBMS_GOLDENGATE_AUTH.GRANT_ADMIN_PRIVILEGE' must be declared
    ORA-06550: line 18, column 1:
    PL/SQL: Statement ignoredif I comment dbms_goldengate_auth it returns perfect result.
    it is  10.2
    PL/SQL procedure successfully completed.
    Elapsed: 00:00:00.03Is there any other way around ????
    Edited by: 949509 on Jan 27, 2013 6:57 PM

    949509 wrote:
    Can you please tell me How i can execute dynamic sql via execute immediate.In a very simialr was as you did the grant of become user in your code. SOmething like:
    declare
       v1          VARCHAR2(200);
       l_grant_str VARCHAR2(1000);
    begin
       select version into v1 from DBA_REGISTRY WHERE COMP_NAME LIKE '%Catalog Views%';
       CASE
          WHEN v1 like '10.2%' THEN
             DBMS_OUTPUT.PUT_LINE('it is  10.2');
             l_grant_str := 'dbms_streams_auth.grant_admin_privilege(''GGADMIN]'')';
          WHEN v1 like '11.1%' THEN
             DBMS_OUTPUT.PUT_LINE('it is  11.1');
             l_grant_str := 'dbms_streams_auth.grant_admin_privilege(''GGADMIN'')';
             EXECUTE IMMEDIATE 'grant become user to GGADMIN';
          WHEN v1 like '11.2.0.3%' THEN
              DBMS_OUTPUT.PUT_LINE('it is  11.2.0.3');
             l_grant_str := 'dbms_goldengate_auth.grant_admin_privilege(''GGADMIN'')';
       END CASE;
       execute immediate l_grant_str;
    end;John

  • Bluetooth in Subaru still not working with ios update

    Bluetooth is still not working in my Subaru with my iphone 6.  I've updated the iOS to 8.1, done most of the suggested tips I've read on line and my phone will still not find my car's (or my plantronic headset).  Bluetooth does work with my jawbone speaker, but that's it.  I'm looking for any new suggestions. Thanks

    I just sold my Motorola RF-850 that was hooked up to my GTO today because it wasn't working with my IPhone.
    I can't believe you paid for the Holden one.
    Anyway good luck.
    AcePilot

  • Need Help...my wireless airport express will not work with my update of snow leopard

    after installing snow leopard on my macbook pro my airport express will not work...or will connect only for a minute at a time.

    If you mean by "airport express" the square airport router you plug in and has a usb port then run the Airport Utility located in your Utilities folder to set it up again. If AU doesn't see it you may need to do a re-set of the AE.

Maybe you are looking for