11.5.10.2-Error:1002,ORA-01002

Hi All,
Application 11.5.10.2,database 9.2.0.6,OS sun solaris,
An Unexpected Error -1002 has occured - a log file has been created. ORA-01002: fetch out of sequence
Please help me inthis regard
thanks in advance.

Hi,
Please mention how do you get the error (mention the steps to reproduce the issue), and what changes have been done recently.
If you have any errors in Apache/Database log files, please post it here.
Did you run AutoConfig and make sure it completes successfully?
Regards,
Hussein

Similar Messages

  • BUG: preview report template errors with ORA-01002

    I've checked on my local install and on apex.oracle.com. I go into the Templates of Shared Components and filter on the Report Templates. Although the preview icon is displayed to allow me to preview the template, I always receive "ORA-01002: fetch out of sequence" on an error page. The only types of Report Templates I have are of type "Generic Columns" so not sure if the problem exists with "Named Columns."
    Can anyone confirm this or correct me on this?
    Shane.

    I wouldn't mind piggy-backing this to ask if the Report Template "shortcut" links at the top of the page can be updated to account for all sections that are now a part of the Report Template. "Before Each Row" and "After Each Row" sections are not listed in the shortcuts. There are also two shortcuts listed as "Before" and "After" which should probably be relabeled.
    Shane.

  • ERROR (ORA-01002)  when Ioading a table by UPDATE/INSERT

    I get the error message ORA-01002 ( Fetch out of sequence ) when I am loading a table by UPDATE/INSERT.
    At de Runtime Audit Viewer the process of loading update a number of register, in that case 44.050 and to the left register I get the error message that I show above.

    Can you please give us some details about your source and targets. I have used UPDATE/INSERT but I did not get this kind of error.
    rgds
    -AP

  • ORA-01002: fetch out of sequence- error when accesing oracle sp from c#

    We have a stored procedure when we exceute it from Sql plus tool ot Toad works fine. But when we call it from C# .ne code gives us the following error.
    ORA-01002: fetch out of sequence ORA-02063: preceding line from SQA1
    Please help.

    with out these lines it works
    (fae_primary_agent_ind = 'X') or
    ((fae_primary_agent_ind is null) and (agn_agt_comp_st_cd = ‘65’)
    This is the stored proc. It works in oracle. It does not work only when we call it from C#.
    CREATE OR REPLACE
    PROCEDURE abc (
    p_report_date IN VARCHAR2,
    p_cur OUT Getadrdata.t_cursor,
    p_run_mode OUT NUMBER
    AS
    v_report_dt DATE;
    backed_out NUMBER := 0;
    previously_paid NUMBER := 0;
    BEGIN
    v_report_dt := TO_DATE (p_report_date, 'DDMMYYYY');
    SELECT COUNT (*)
    INTO backed_out
    FROM r2t_adr_payment a, DUAL
    WHERE a.fap_acctg_dt = v_report_dt
    AND a.fap_status_cd = 'B';
    IF backed_out = 0
    THEN
         SELECT COUNT (*)
    INTO previously_paid
    FROM r2t_adr_payment a, DUAL
    WHERE a.fap_acctg_dt = v_report_dt
    AND a.fap_status_cd = 'P';
    END IF;
    IF backed_out > 0 or previously_paid > 0
    THEN
    p_run_mode := 2;
    OPEN p_cur FOR
    SELECT fae_agent_nbr agent_nbr, fae_ssn_last_4digits ssn_nbr,
    fae_address_ln1 address_line1, fae_address_ln2 address_line2,
    fae_city_nm city, fae_state_cd state, fae_zip_cd zip,
    fae_bus_phone business_phone, fae_supv_region_cd region,
    fae_territory_cd territory, fae_market_cd market,
    -- FAE_AGT_COMP_ST_CD COMP_STAT_CD,
    agn_agt_comp_st_cd comp_stat_cd, fae_emplmt_dt emp_date,
    fae_agent_type_cd status_cd, fae_first_nm first_name,
    fae_last_nm last_name,
    rpt_agent_bonus_class_id p_agent_bonus_class_id
    FROM r2t_adr_epc_agent_info LEFT OUTER JOIN rgt_points
    ON fae_agent_nbr = rpt_agent_nbr
    LEFT OUTER JOIN p1t_tot_agent ON fae_agent_nbr =
    agn_agent_nbr
    INNER JOIN r2t_adr_payment
    ON fae_agent_nbr = fap_primary_agent_nbr
    WHERE FAE_AGENT_TYPE_CD = '41'
    AND rpt_acctg_dt = v_report_dt
    AND v_report_dt BETWEEN agn_start_eff_dt AND agn_end_eff_dt
    AND fap_acctg_dt = v_report_dt
    AND fap_status_cd = 'B'
    UNION ALL
    SELECT fae_agent_nbr agent_nbr, fae_ssn_last_4digits ssn_nbr,
    fae_address_ln1 address_line1, fae_address_ln2 address_line2,
    fae_city_nm city, fae_state_cd state, fae_zip_cd zip,
    fae_bus_phone business_phone, fae_supv_region_cd region,
    fae_territory_cd territory, fae_market_cd market,
    -- FAE_AGT_COMP_ST_CD COMP_STAT_CD,
    agn_agt_comp_st_cd comp_stat_cd, fae_emplmt_dt emp_date,
    fae_agent_type_cd status_cd, fae_first_nm first_name,
    fae_last_nm last_name,
    0 p_agent_bonus_class_id
    FROM r2t_adr_epc_agent_info
    LEFT OUTER JOIN p1t_tot_agent ON fae_agent_nbr =
    agn_agent_nbr
    INNER JOIN r2t_adr_payment
    ON fae_agent_nbr = fap_primary_agent_nbr
    WHERE fae_agent_type_cd = '13'
    AND v_report_dt BETWEEN agn_start_eff_dt AND agn_end_eff_dt
    AND fap_acctg_dt = v_report_dt
    AND fap_status_cd = 'B';
    ELSE
    p_run_mode := 1;
    OPEN p_cur FOR
    SELECT fae_agent_nbr agent_nbr, fae_ssn_last_4digits ssn_nbr,
    fae_address_ln1 address_line1, fae_address_ln2 address_line2,
    fae_city_nm city, fae_state_cd state, fae_zip_cd zip,
    fae_bus_phone business_phone, fae_supv_region_cd region,
    fae_territory_cd territory, fae_market_cd market,
    -- FAE_AGT_COMP_ST_CD COMP_STAT_CD,
    agn_agt_comp_st_cd comp_stat_cd, fae_emplmt_dt emp_date,
    fae_agent_type_cd status_cd, fae_first_nm first_name,
    fae_last_nm last_name,
    rpt_agent_bonus_class_id p_agent_bonus_class_id
    FROM r2t_adr_epc_agent_info LEFT OUTER JOIN rgt_points
    ON fae_agent_nbr = rpt_agent_nbr
    LEFT OUTER JOIN p1t_tot_agent ON fae_agent_nbr =
    agn_agent_nbr
    WHERE rpt_acctg_dt = v_report_dt
    -- Next line for testing of a subset of data - testing purposes only
    -- AND FAE_SUPV_REGION_CD ='002'
    AND FAE_AGENT_TYPE_CD = '41'
    AND (
    (RPT_AGENT_BONUS_CLASS_ID = '3' AND SUBSTR(FAE_EMPLMT_DT,1,2) <> '01' AND ADD_MONTHS(FAE_EMPLMT_DT, 7 ) <= v_report_dt) OR
    (RPT_AGENT_BONUS_CLASS_ID = '3' AND SUBSTR(FAE_EMPLMT_DT,1,2) = '01' AND ADD_MONTHS(FAE_EMPLMT_DT, 6 ) <= v_report_dt) OR
    (RPT_AGENT_BONUS_CLASS_ID = '1')
    AND (
    (fae_primary_agent_ind = 'X') or
    ((fae_primary_agent_ind is null) and (agn_agt_comp_st_cd = ‘65’)
    AND v_report_dt BETWEEN agn_start_eff_dt AND agn_end_eff_dt
    UNION ALL
    SELECT fae_agent_nbr agent_nbr, fae_ssn_last_4digits ssn_nbr,
    fae_address_ln1 address_line1, fae_address_ln2 address_line2,
    fae_city_nm city, fae_state_cd state, fae_zip_cd zip,
    fae_bus_phone business_phone, fae_supv_region_cd region,
    fae_territory_cd territory, fae_market_cd market,
    -- FAE_AGT_COMP_ST_CD COMP_STAT_CD,
    agn_agt_comp_st_cd comp_stat_cd, fae_emplmt_dt emp_date,
    fae_agent_type_cd status_cd, fae_first_nm first_name,
    fae_last_nm last_name, 0 p_agent_bonus_class_id
    FROM r2t_adr_epc_agent_info LEFT OUTER JOIN p1t_tot_agent
    ON fae_agent_nbr = agn_agent_nbr
    WHERE fae_agent_type_cd = '13'
    -- Next line for testing of a subset of data - testing purposes only
    -- AND FAE_SUPV_REGION_CD ='002'
    AND fae_primary_agent_ind = 'X'
    AND v_report_dt BETWEEN agn_start_eff_dt AND agn_end_eff_dt;
    END IF;
    EXCEPTION
    WHEN NO_DATA_FOUND
    THEN
    --DBMS_OUTPUT.PUT_LINE ('no data ' || SQLERRM);
    NULL;
    WHEN OTHERS
    THEN
    --DBMS_OUTPUT.PUT_LINE ('error ' || SQLERRM);
    --OPEN p_cur FOR
    -- SELECT NULL
    -- FROM DUAL;
              RAISE;
    END abc;

  • ORA-01002

    Hi!.
    I've got a problem with Reports 2.5. Sometimes when I call a Report from Forms an error success "ORA-01002 --> fetch out of sequence" and I don4t know what i have to do in order to resolve it.
    Thanks.

    Hi,
    I've seen this problem resolved in 2.5 by upping the number of cursors in OPEN_CURSORS in the init.ora for the database. You can also try setting the commandline parameter NONBLOCKSQL to NO as that has worked in other cases. In 3.0 this is set to no by default, but in 2.5, the default is yes.
    Hope that helps,
    Toby

  • Bug and Fix: Report Template Preview displays ORA-01002

    Hi, omniscient All!
    Let me share some knowledge with you. There is an old APEX bug:
    BUG: preview report template errors with ORA-01002
    Report Template Preview/Copy Error
    Template Preview Error:
    You can definitely see it in 4.0, 4.1, 4.2, 4.2.1 versions: open any database application in AppBuilder, go to Shared Components→Templates, move cursor on Some Report Template row, click Preview Icon. Voilà:
    report error:
    ORA-01002: fetch out of sequenceI looked into Template Preview region's source and have found next WWV_RENDER_REPORT3.show call:
    wwv_render_report3.show(
        p_query => '
    select 1 COL1, ''[...]'' COL2, ''[...]'' COL3, sysdate COL4 from dual union
    select 2 COL1, ''[...]'' COL2, ''[...]'' COL3, sysdate COL4 from dual union
    select 3 COL1, ''[...]'' COL2, ''[...]'' COL3, sysdate COL4 from dual union
    select 4 COL1, ''[...]'' COL2, ''[...]'' COL3, sysdate COL4 from dual union
    select 5 COL1, ''[...]'' COL2, ''[...]'' COL3, sysdate COL4 from dual union
    select 6 COL1, ''[...]'' COL2, ''[...]'' COL3, sysdate COL4 from dual
    order by 1',
        p_row_template_id => :f4000_p245_id,
        p_region_id => 88449328191587806
      );I have no wish to go deep into my further investigation, therefore I just call a cause: APEX Team, you forgot to set the value of P_PLUG_SOURCE_TYPE parameter.
    Workaround: While APEX Team will making a patch, those who can't wait it should fix it manually by executing next code:
    update &APEX_SCHEMA.wwv_flow_page_plugs
       set plug_source = q'{wwv_render_report3.show(
        p_query => '
    select 1 COL1, ''[...]'' COL2, ''[...]'' COL3, sysdate COL4 from dual union
    select 2 COL1, ''[...]'' COL2, ''[...]'' COL3, sysdate COL4 from dual union
    select 3 COL1, ''[...]'' COL2, ''[...]'' COL3, sysdate COL4 from dual union
    select 4 COL1, ''[...]'' COL2, ''[...]'' COL3, sysdate COL4 from dual union
    select 5 COL1, ''[...]'' COL2, ''[...]'' COL3, sysdate COL4 from dual union
    select 6 COL1, ''[...]'' COL2, ''[...]'' COL3, sysdate COL4 from dual
    order by 1',
        p_row_template_id => :f4000_p245_id,
        p_region_id => 88449328191587806,
        p_plug_source_type => 'SQL_QUERY'
    where id = 14562627207747006
    /APEX_SCHEMA is schema where APEX was installed.
    Good luck,
    Alex
    Edited by: tiPPLer on 14.02.2013 17:14

    I wouldn't mind piggy-backing this to ask if the Report Template "shortcut" links at the top of the page can be updated to account for all sections that are now a part of the Report Template. "Before Each Row" and "After Each Row" sections are not listed in the shortcuts. There are also two shortcuts listed as "Before" and "After" which should probably be relabeled.
    Shane.

  • ORA-01002-Error in Select ... for update

    I would like to insert CLOB in a table (VP_EVENTS) with a primary key (eventid) with the following code:
    String content = "AAAAAAAAAAAAABBBBBBBBBBXXX";
    PreparedStatement cs = this.con.prepareStatement("INSERT INTO vp_events (eventid,term,participant)
    VALUES (?,?,empty_clob())");
    //Register IN-Parameter
    cs.setInt(1, 1);
    cs.setInt(2, 1);
    cs.setTimestamp(3, new java.sql.Timestamp( System.currentTimeMillis() ));
    //Execute statement
    cs.execute();
    cs.close();
    Statement stmt = con.createStatement();
    ResultSet clobLocatorSet = stmt.executeQuery( "SELECT PARTICIPANT FROM VP_EVENTS WHERE EVENTID=1 FOR UPDATE");
    // Get the CLOB-locator
    if (clobLocatorSet.next())
    oracle.sql.CLOB clob =
    ((oracle.jdbc.driver.OracleResultSet)
    clobLocatorSet).getCLOB(1);
    // Write CLOB-Data
    // The first parameter to plsql_write, is // the offset from which to start
    // writing, and the second parameter is the // data to be written.
    // plsql_length(), returns the length of // the data in the CLOB column
    countCLOB = clob.plsql_write(
    0,content.toCharArray());
    At the execution-point of the "Select for Update"-statement the oracle thin driver throws the Error "Fetch out of sequence ORA-01002".
    What's wrong?

    Connection conn = DriverManager.getConnection ("jdbc racle:thin:@myhost:1521:ORCL","scott", "tiger");
    conn.setAutoCommit(false);
    Statement stmt = conn.createStatement ();
    null

  • Error ORA-01002: fetch out of sequence

    Hi all,
    I created 3 cursors. The scenario is like following :
    Begin Cur A
    Begin FOR xx IN Cur B LOOP
    Begin FOR xx IN Cur C LOOP
    End LOOP Cur C;
    commit;
    End LOOP Cur B;
    End Cur A;
    When i run the program its display error ORA-01002: fetch out of sequence.
    The objective of my program is to insert into table and commit every transaction.
    Kindly share info with me why this error happened.
    TQ.
    tim

    Tim,
    Refer to the following:
    ORA-01002: fetch out of sequence
    Cause: This error means that a fetch has been attempted from a cursor which is no longer valid.
    Note that a PL/SQL cursor loop implicitly does fetches, and thus may also cause this error. There are a number of possible causes for this error, including:
    1) Fetching from a cursor after the last row has been retrieved and the ORA-1403 error returned.
    2) If the cursor has been opened with the FOR UPDATE clause, fetching after a COMMIT has been issued will return the error.
    3) Rebinding any placeholders in the SQL statement, then issuing a fetch before reexecuting the statement.
    Action:
    1) Do not issue a fetch statement after the last row has been retrieved - there are no more rows to fetch.
    2) Do not issue a COMMIT inside a fetch loop for a cursor that has been opened FOR UPDATE.
    3) Reexecute the statement after rebinding, then attempt to fetch again.
    HTH,
    Thierry
    Edited by: Thierry H. on May 4, 2011 12:30 PM Reformatting

  • WLS 5.1 to 6.1 porting issue: RequiresNew & ORA-01002 error

    Repost from the EJB group
    Environment:
    WLS 6.1.2 on WINNT w/SP6a
    java: 1.3.1 that ships with WLS 6.1
    DB: Oracle 8.1.6 (using TRANSACTION_READ_COMMITTED exclusively)
    I'm currently upgrading our application from 5.1 (ejb 1.1) to
    6.1 (ejb 2.0). I've also consolidated our 55 separate ejb jars
    into a single jar (with all 55 ejbs). Because of 1.1 entity bean
    issues, currently all our ejbs are SessionBeans. Everything works
    under 5.1 with our test Oracle instance, the 6.1 test environment
    is using the same database instance.
    I'm seeing several problems.
    Here's #1
    With the same TCUSecurityDataAccessSessionBean::updateIfNeeded
    source code and same database instance. 5.1 updates correctly,
    6.1 throws this SQLException. So, I figure its got to be a WLS 6.1 issue or
    my configuration. - I alway suspect me ;)
    ERROR - ORA-01002: fetch out of sequence
    (com.eoriginal.engine.core.session.basicAccess.TCUSecurityDataAccessSessionB
    ean_ridhfi_Impl::updateIfNeeded)
    java.sql.SQLException: ORA-01002: fetch out of sequence
    This method should be configured with transaction context of: RequiresNew
    Has the 6.1 handling of RequiresNew changed that radically?
    I'm looking for suggestions on how to debug this further.
    TIA
    Gordon
    ------------- ejb-jar.xml (edited) ------------------------
    <ejb-jar>
    <small-icon>images/green-cube.gif</small-icon>
    <enterprise-beans>
    <!-- TCUSecurityDataAccessSession -->
    <session>
    <small-icon>images/orange-cube.gif</small-icon>
    <ejb-name>TCUSecurityDataAccessSession</ejb-name>
    <home>com.eoriginal.engine.core.session.basicAccess.TCUSecurityDataAccessSes
    sionHome</home>
    <remote>com.eoriginal.engine.core.session.basicAccess.TCUSecurityDataAccessS
    ession</remote>
    <ejb-class>com.eoriginal.engine.core.session.basicAccess.TCUSecurityDataAcce
    ssSessionBean</ejb-class>
    <session-type>Stateless</session-type>
    <transaction-type>Container</transaction-type>
    </session>
    </enterprise-beans>
    <assembly-descriptor>
    <method-permission>
    <description></description>
    <role-name>****</role-name> <!-- deleted for security -->
    <method>
    <ejb-name>TCUSecurityDataAccessSession</ejb-name>
    <method-name>*</method-name>
    </method>
    </method-permission>
    <!-- TCUSecurityDataAccessSession -->
    <container-transaction>
    <method>
    <ejb-name>TCUSecurityDataAccessSession</ejb-name>
    <method-name>updateIfNeeded</method-name>
    </method>
    <trans-attribute>RequiresNew</trans-attribute>
    </container-transaction>
    <container-transaction>
    <method>
    <ejb-name>TCUSecurityDataAccessSession</ejb-name>
    <method-name>peek</method-name>
    </method>
    <trans-attribute>Supports</trans-attribute>
    </container-transaction>
    </assembly-descriptor>
    </ejb-jar>
    ------------- weblogic-ejb-jar.xml (uninteresting) ------------------------
    ------------- config.xml (edited) ------------------------
    <JDBCConnectionPool CapacityIncrement="5"
    DriverName="oracle.jdbc.driver.OracleDriver"
    InitialCapacity="10" MaxCapacity="100" Name="d2Pool"
    Password="*****
    Properties="user=d2engine;STATEMENT_CACHE_SIZE=200"
    Targets="myserver" URL="jdbc:oracle:thin:@*****"/>
    <JDBCTxDataSource JNDIName="jdbc/d2Pool" Name="jdbc/d2Pool"
    PoolName="d2Pool" Targets="myserver"/>
    ORA-01002 fetch out of sequence
    Cause: In a host language program, a FETCH call was issued out of sequence.
    A successful parse-and-execute call must be issued before a fetch.
    This can occur if an attempt was made to FETCH from an active set after
    all records have been fetched.
    This may be caused by fetching from a SELECT FOR UPDATE cursor after a
    commit.
    A PL/SQL cursor loop implicitly does fetches and may also cause this error.
    Action: Parse and execute a SQL statement before attempting to fetch the
    data.

    Solved.
    The 8.1.6 driver wasn't the problem.
    It turned out that our ConnectionPool utility class wasn't configured
    properly
    and when I thought that I was going TxDatasource, I was actually only
    getting
    a straight Connection. No Tx, so Oracle didn't have one open for the "FOR
    UPDATE"
    clause. Now if someone could help on my classloader question in the EJB
    group ;)
    - Gordon
    "Slava Imeshev" <[email protected]> wrote in message
    news:[email protected]...
    Gordon,
    Oracle 8.1.6 driver proved to be buggy and unstable.
    Can you update your oracle thin driver to the newest
    one? It's available from the otn.oracle.com.
    Could you also post the questionable code here, especially
    in the part related to obtaining connection, executing
    stataments, fetching results and obtaining TXs, if any?
    Regards,
    Slava Imeshev
    "Gordon Twaddell" <[email protected]> wrote in message
    news:[email protected]...
    Sree,
    I didn't mention that I'm using the Oracle thin JDBC driver
    (8.1.6.1)
    and its in the CLASSPATH.
    Slava,
    I tried the stmt.setFetchSize(). I got the same result.
    Gordon
    "Sree Bodapati" <[email protected]> wrote in message
    news:[email protected]...
    Hi Gordon,
    One possibility is the environment variable PATH might be pointing to
    an
    older version of the library files for the WebLogic jDriver forOracle.
    Check if the PATH is set to point to the right weblogicoci37.dll (inthe
    <WL_HOME for 6.1>\bin\oci817_8) and make sure your oracle_home is setto
    point to the right folders as well.
    hth
    sree
    "Gordon Twaddell" <[email protected]> wrote in message
    news:[email protected]...
    Repost from the EJB group
    Environment:
    WLS 6.1.2 on WINNT w/SP6a
    java: 1.3.1 that ships with WLS 6.1
    DB: Oracle 8.1.6 (using TRANSACTION_READ_COMMITTED exclusively)
    I'm currently upgrading our application from 5.1 (ejb 1.1) to
    6.1 (ejb 2.0). I've also consolidated our 55 separate ejb jars
    into a single jar (with all 55 ejbs). Because of 1.1 entity bean
    issues, currently all our ejbs are SessionBeans. Everything works
    under 5.1 with our test Oracle instance, the 6.1 test environment
    is using the same database instance.
    I'm seeing several problems.
    Here's #1
    With the same TCUSecurityDataAccessSessionBean::updateIfNeeded
    source code and same database instance. 5.1 updates correctly,
    6.1 throws this SQLException. So, I figure its got to be a WLS 6.1
    issue
    or
    my configuration. - I alway suspect me ;)
    ERROR - ORA-01002: fetch out of sequence
    (com.eoriginal.engine.core.session.basicAccess.TCUSecurityDataAccessSessionB
    ean_ridhfi_Impl::updateIfNeeded)
    java.sql.SQLException: ORA-01002: fetch out of sequence
    This method should be configured with transaction context of:RequiresNew
    Has the 6.1 handling of RequiresNew changed that radically?
    I'm looking for suggestions on how to debug this further.
    TIA
    Gordon
    ------------- ejb-jar.xml (edited) ------------------------
    <ejb-jar>
    <small-icon>images/green-cube.gif</small-icon>
    <enterprise-beans>
    <!-- TCUSecurityDataAccessSession -->
    <session>
    <small-icon>images/orange-cube.gif</small-icon>
    <ejb-name>TCUSecurityDataAccessSession</ejb-name>
    <home>com.eoriginal.engine.core.session.basicAccess.TCUSecurityDataAccessSes
    sionHome</home>
    <remote>com.eoriginal.engine.core.session.basicAccess.TCUSecurityDataAccessS
    ession</remote>
    <ejb-class>com.eoriginal.engine.core.session.basicAccess.TCUSecurityDataAcce
    ssSessionBean</ejb-class>
    <session-type>Stateless</session-type>
    <transaction-type>Container</transaction-type>
    </session>
    </enterprise-beans>
    <assembly-descriptor>
    <method-permission>
    <description></description>
    <role-name>****</role-name> <!-- deleted for security -->
    <method>
    <ejb-name>TCUSecurityDataAccessSession</ejb-name>
    <method-name>*</method-name>
    </method>
    </method-permission>
    <!-- TCUSecurityDataAccessSession -->
    <container-transaction>
    <method>
    <ejb-name>TCUSecurityDataAccessSession</ejb-name>
    <method-name>updateIfNeeded</method-name>
    </method>
    <trans-attribute>RequiresNew</trans-attribute>
    </container-transaction>
    <container-transaction>
    <method>
    <ejb-name>TCUSecurityDataAccessSession</ejb-name>
    <method-name>peek</method-name>
    </method>
    <trans-attribute>Supports</trans-attribute>
    </container-transaction>
    </assembly-descriptor>
    </ejb-jar>
    ------------- weblogic-ejb-jar.xml(uninteresting) ------------------------
    ------------- config.xml (edited) ------------------------
    <JDBCConnectionPool CapacityIncrement="5"
    DriverName="oracle.jdbc.driver.OracleDriver"
    InitialCapacity="10" MaxCapacity="100" Name="d2Pool"
    Password="*****
    Properties="user=d2engine;STATEMENT_CACHE_SIZE=200"
    Targets="myserver" URL="jdbc:oracle:thin:@*****"/>
    <JDBCTxDataSource JNDIName="jdbc/d2Pool" Name="jdbc/d2Pool"
    PoolName="d2Pool" Targets="myserver"/>
    ORA-01002 fetch out of sequence
    Cause: In a host language program, a FETCH call was issued out ofsequence.
    A successful parse-and-execute call must be issued before a fetch.
    This can occur if an attempt was made to FETCH from an active set
    after
    all records have been fetched.
    This may be caused by fetching from a SELECT FOR UPDATE cursor
    after
    a
    commit.
    A PL/SQL cursor loop implicitly does fetches and may also cause
    this
    error.
    Action: Parse and execute a SQL statement before attempting to fetch
    the
    data.

  • ORA-01002: fetch out of sequence error when using Oracle Thin Driver 9i with Weblogic 6.1

    The simple program below is a client that executes a SELECT query -
    there are 13 rows in the table, of which 10 are printed when I run the
    program, then after that the ORA-01002 error is reported. I am not
    doing anything with LOBs, or updates. I've tried putting
    con.setAutoCommit(false) as well, but that does not do anything.
    Why am I getting this error? Can anyone help.
    Thanks
    -H
    Context ctx = null;
    Hashtable ht = new Hashtable();
    ht.put(Context.INITIAL_CONTEXT_FACTORY,
    "weblogic.jndi.WLInitialContextFactory");
    ht.put(Context.PROVIDER_URL,
    "t3://127.0.0.1:7001");
    PreparedStatement stmt = null;
    ResultSet rs = null;
    UserTransaction ut = null;
    try {
    ctx = new InitialContext(ht);
    javax.sql.DataSource ds
    = (javax.sql.DataSource) ctx.lookup ("jtaXADS");
    java.sql.Connection conn = ds.getConnection();
    // You can now use the conn object to create
    // Statements and retrieve result sets:
    ut = (UserTransaction)
    ctx.lookup("javax.transaction.UserTransaction");
    ut.begin();
    stmt = conn.prepareStatement("select firstname,surname from
    EMPLOYEE ");
    stmt.executeQuery();
    rs = stmt.getResultSet();
    // Close the statement and connection objects when you are finished:
    while (rs.next())
    System.out.println("Result is " + rs.getString("firstname") + " " +
    rs.getString("surname"));
    ut.commit();
    stmt.close();
    conn.close();
    catch (Exception e) {
    e.printStackTrace();
    // a failure occurred
    finally {
    try {ctx.close();
    rs.close();}
    catch (Exception e) {
    // a failure occurred
    e.printStackTrace();

    Thanks everybody.
    I have tried this, calling ut.begin() first before getConnection,
    however no difference. However the problem goes away if I call
    stmt.setFetchSize(100);
    But I would prefer not to have to code this in every time!!!
    I see there is a setting within Weblogic Admin console to see the
    row-prefetch, but that is already set to 45 rows, so why do have to
    explicitly call stmt.setFetchSize(100)!!!
    Thanks
    -H
    "Carl Lawstuen" <[email protected]> wrote in message news:<[email protected]>...
    Agreed. The transaction must start before the connection. This is what
    is most likely causing the error.
    "Nils Winkler" <[email protected]> wrote in message
    news:[email protected]...
    Hi,
    one more thing: The UserTransaction has to be started before you obtain
    the connection, not after.
    Nils
    Humphrey wrote:
    The simple program below is a client that executes a SELECT query -
    there are 13 rows in the table, of which 10 are printed when I run the
    program, then after that the ORA-01002 error is reported. I am not
    doing anything with LOBs, or updates. I've tried putting
    con.setAutoCommit(false) as well, but that does not do anything.
    Why am I getting this error? Can anyone help.
    Thanks
    -H
    Context ctx = null;
    Hashtable ht = new Hashtable();
    ht.put(Context.INITIAL_CONTEXT_FACTORY,
    "weblogic.jndi.WLInitialContextFactory");
    ht.put(Context.PROVIDER_URL,
    "t3://127.0.0.1:7001");
    PreparedStatement stmt = null;
    ResultSet rs = null;
    UserTransaction ut = null;
    try {
    ctx = new InitialContext(ht);
    javax.sql.DataSource ds
    = (javax.sql.DataSource) ctx.lookup ("jtaXADS");
    java.sql.Connection conn = ds.getConnection();
    // You can now use the conn object to create
    // Statements and retrieve result sets:
    ut = (UserTransaction)
    ctx.lookup("javax.transaction.UserTransaction");
    ut.begin();
    stmt = conn.prepareStatement("select firstname,surname from
    EMPLOYEE ");
    stmt.executeQuery();
    rs = stmt.getResultSet();
    // Close the statement and connection objects when you are finished:
    while (rs.next())
    System.out.println("Result is " + rs.getString("firstname") + " " +
    rs.getString("surname"));
    ut.commit();
    stmt.close();
    conn.close();
    catch (Exception e) {
    e.printStackTrace();
    // a failure occurred
    finally {
    try {ctx.close();
    rs.close();}
    catch (Exception e) {
    // a failure occurred
    e.printStackTrace();
    ============================
    [email protected]

  • ORA 01002 error - Fetch out of sequence

    I am using COMMIT statement inside CURSOR FOR LOOP after inserting records. I am not using FOR UPDATE. But still I see fetch out of sequence error. I need to do commit intervals of every 1000 insert statements. How to resolve this error?

    The reason of your error from oracle point of view is --
    ORA-01002: fetch out of sequence
    Cause: This error means that a fetch has been attempted from a cursor which is no longer valid. Note that a PL/SQL cursor loop implicitly does fetches, and thus may also cause this error. There are a number of possible causes for this error, including: 1) Fetching from a cursor after the last row has been retrieved and the ORA-1403 error returned. 2) If the cursor has been opened with the FOR UPDATE clause, fetching after a COMMIT has been issued will return the error. 3) Rebinding any placeholders in the SQL statement, then issuing a fetch before reexecuting the statement.
    Action: 1) Do not issue a fetch statement after the last row has been retrieved - there are no more rows to fetch. 2) Do not issue a COMMIT inside a fetch loop for a cursor that has been opened FOR UPDATE. 3) Reexecute the statement after rebinding, then attempt to fetch again.
    Now, my question is - are attempting any fetches inside any for loop - which will throw this error? Just check it - and let us know your feedback.
    Regards.
    Satyaki De.

  • ORA-01002 error

    With the Oracle 8.1.7 thin driver I am getting an ORA-01002 error -fetch
    out of sequence
    I am setting the autocommit to false. Is there something else I should
    do. If I know at most one row is going to be fetched should I set the
    fetch size to 1 ? Will that remove the problem ?
    Thanks.

    Aswin
    Set the statement fetch size to be at least the result set size.
    stmt.setFetchSize()
    Deepak
    Aswin Dinakar wrote:
    With the Oracle 8.1.7 thin driver I am getting an ORA-01002 error -fetch
    out of sequence
    I am setting the autocommit to false. Is there something else I should
    do. If I know at most one row is going to be fetched should I set the
    fetch size to 1 ? Will that remove the problem ?
    Thanks.

  • Autonomous Transactions & error ORA-01002

    Either there's a bug w/ Autonomous Transactions or the documentation is incomplete because the AT is not working when
    called from within Cursor Loop.
    here's the outline:
    CURSOR acct_cur IS ...FOR UPDATE OF a.account_nm...
    FOR acct_rec IN acct_cur LOOP
    fis_rte_util.print_msg (...) ---autonomous transaction writes to a logging table
    ---w/ commit
    UPDATE ca_account_t
    SET account_nm = acct_rec.account_nm....
    this update statement causes a ORA-01002: fetch out of sequence exception. if
    i comment out the print_msg line it works just fine. its as if the commit in the
    AT is causing the problem. according to the documention, there should be no
    interference between these 2 blocks.
    thanks for any info or insight,
    swg
    null

    Tim,
    Refer to the following:
    ORA-01002: fetch out of sequence
    Cause: This error means that a fetch has been attempted from a cursor which is no longer valid.
    Note that a PL/SQL cursor loop implicitly does fetches, and thus may also cause this error. There are a number of possible causes for this error, including:
    1) Fetching from a cursor after the last row has been retrieved and the ORA-1403 error returned.
    2) If the cursor has been opened with the FOR UPDATE clause, fetching after a COMMIT has been issued will return the error.
    3) Rebinding any placeholders in the SQL statement, then issuing a fetch before reexecuting the statement.
    Action:
    1) Do not issue a fetch statement after the last row has been retrieved - there are no more rows to fetch.
    2) Do not issue a COMMIT inside a fetch loop for a cursor that has been opened FOR UPDATE.
    3) Reexecute the statement after rebinding, then attempt to fetch again.
    HTH,
    Thierry
    Edited by: Thierry H. on May 4, 2011 12:30 PM Reformatting

  • Error on mapping: ORA-01002

    Hi all,
    When i try to insert data from an Informix database into Oracle the mapping crashes with the error ora-01002 after 50 rows (the number of rows has some relation to Bulk Size, because when it grows the error occurs in a later row).
    I can insert the data into the table using the same connection that OWB using SQL*Plus.
    what can be the problem?
    I'm using OWB 9.2.
    thanks,
    Vitor

    Hi,
    The error that i've got on Runtime Audit Browser is "ORA-01002: fetch out of sequence ORA-02063: preceding line HSODBC@CON_STAGING_TO_INFORMIX". (HSODBC@CON_STAGING_TO_INFORMIX is the DB Link Created by OWB)
    Answering to Mahesh, no, i can't use the Loading Type "INSERT/UPDATE" on the same table, because the fields are not the same, the INSERT has more fields then UPDATE.
    Thanks,
    Vitor

  • ORA-01002: fetch out of sequence error

    Hello friends,
    I m facing a prob using a cursor for update.
    here is a piece of code:
    DECLARE
                   CURSOR c_tot_inv_qty (p_prd_id tr_periods.period_id%TYPE) IS
    SELECT total_inv_qty, item_id, period_id, dc_id
    FROM inv_dc_tmp
    WHERE period_id = p_prd_id + 1
    FOR UPDATE OF total_inv_qty;
    BEGIN
              FOR pd IN (     SELECT period_id
                             FROM tr_periods
                             WHERE status_flag = 1
                             AND period_id >= 46
    LOOP
                   FOR t_tot_inv_qty IN c_tot_inv_qty(pd.period_id) LOOP
                        BEGIN
    SELECT inv_forecast_qty
    INTO l_inv_fc_qty
    FROM inv_dc_tmp
    WHERE item_id = t_tot_inv_qty.item_id
    AND period_id = pd.period_id
    AND dc_id = t_tot_inv_qty.dc_id;
                        EXCEPTION
                             WHEN NO_DATA_FOUND THEN
                                  l_inv_fc_qty := 0;
                        END;
    UPDATE inv_dc_tmp
    SET total_inv_qty = l_inv_fc_qty
    WHERE CURRENT OF c_tot_inv_qty;
                   END LOOP;
              END LOOP;
              COMMIT;
    END;
    i have written commit after the loop..but still it raise an error ORA-01002: fetch out of sequence
    i m unable to find out the soln
    i need ur help.
    Thanks
    RSD

    I'm not sure what your code is trying to accomplish, but give this a whirl. It might be better than all that looping and cursors. I don't have any sample data/tables so I'm largely guessing here.
    update inv_dc_tmp i
    set    i.total_inv_qty =
              (select sum(t.inv_forecast_qty)
               from   inv_dc_tmp t
                     ,tr_periods p
               where  t.period_id = p.period_id
               and    p.status_flag = 1
               and    p.period_id >= 46
               and    t.period_id     = i.period_id - 1
               and    t.item_id       = i.item_id
               and    t.dc_id         = i.dc_id
    where exists
              (select 1
               from   tr_periods p
               where  p.period_id = i.period_id - 1
               and    p.status_flag = 1
               and    p.period_id >= 46
    ;Extremely UNtested.

Maybe you are looking for

  • There is a new firmware for my N70 but NSU says ot...

    I have an N70 which currently has firmware version 5.0609.2.0.1 installed on it. I am pretty sure that there is a newer version available as confirmed in the software update availability page here. When I use my product code (which is 0523985) it say

  • F9 / Ctrl-Enter not working in SQL Worksheet

    Win XP Pro, up to date patches, SQL Developer Help - About - Version Java(TM) Platform     1.6.0_11 Oracle IDE     3.0.04.34 Versioning Support     3.0.04.34 All of a sudden (yesterday morning) both F9 and Ctrl Enter have stopped working - I cannot o

  • Why wont my ibook save my settings after restart?

    i have a snow ibook g3 power pc 500mhz, 256mb of ram, 15gb hdd, os x tiger. this is my first mac, i plan on using it as training wheels before i go out and get a macbook air. i have tis problem where i make changes to the dock, short name, time and d

  • IEEE 802.1x Authentication with RADIUS failed

    Hello guys, I've a little strange Situation. If user start his Computer (Windows 7 enterprise) and computer is connected via LAN it works fine. If user start his Computer (Windows 7 enterprise) and computer is connected via WLAN it works also fine. B

  • Making Flash Player Default Program for .flv Files

    I'd like to use Adobe Flash Player as my default program to open .flv files.  How do I find the flash player executable file on my computer?  I have the latest flash player successfully installed on my computer (Win7, 64-bit, Firefox) but cannot loca