Forum Stats

  • 3,770,393 Users
  • 2,253,101 Discussions
  • 7,875,437 Comments

Discussions

SQL error 1002

chris218-Oracle
chris218-Oracle Member Posts: 1
edited Sep 7, 2008 11:16PM in SQL & PL/SQL
Hi,

I'm having a hard time in finding the cause for this sql error. At one time it would show up but the cursor haven't really closed yet (I can't see any SQL close) and there are still records to retrieve.

Any ideas on this one would really help.

Thanks!
Tagged:

Answers

  • damorgan
    damorgan Member Posts: 14,464 Bronze Crown
    The answer is 42.

    No version number.
    No DDL.
    No DML.
    No error message (SQL error 1002 is not an Oracle error message)

    No one can possibly help you.

    PS: I've never seen a "SQL close" in my life. Are you sure you are working in the Oracle database?
  • John Spencer
    John Spencer Member Posts: 8,567 Bronze Crown
    01002, 00000, "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.
  • 658148
    658148 Member Posts: 65
    This may help

    http://errorkey.com/Search/index.aspx?q=fetch+out+of+sequence

    http://www.errorkey.com/search/index.aspx?q=1002&pr=ORACLE
  • damorgan
    damorgan Member Posts: 14,464 Bronze Crown
    So far you have made 32 posts to these forums and a review of them has shown that each and every one is links to a website that contains to things.

    1. Docs copied word-for-word from Oracle's own docs.
    2. Spam

    I have reported the spam to forum management and will report the plagiarism of copyrighted docs to Oracle legal tomorrow morning.
This discussion has been closed.