Matching SQLCODES to SQL Statements

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • BugleBoy

    #1

    Matching SQLCODES to SQL Statements

    Is there a guide, pamphlet, book, website, PDF or scroll somewhere
    which states the SQLCODES which are valid for each SQL statement
    (i.e., INSERT, CALL, FETCH, DECLARE CURSOR) in IBM DB2 (v7 or 8)?

    I sometimes fall into the situation where someone has coded (or not) a
    questionable EVALUATE SQLCODE statement after an EXEC SQL statement.

    Thanks to all of you, in advance, for your support!
  • louisem

    #2
    Re: Matching SQLCODES to SQL Statements

    On Nov 29, 2:55 pm, BugleBoy <dfaill...@gmai l.comwrote:
    Is there a guide, pamphlet, book, website, PDF or scroll somewhere
    which states the SQLCODES which are valid for each SQL statement
    (i.e., INSERT, CALL, FETCH, DECLARE CURSOR) in IBM DB2 (v7 or 8)?
    >
    I sometimes fall into the situation where someone has coded (or not) a
    questionable EVALUATE SQLCODE statement after an EXEC SQL statement.
    >
    Thanks to all of you, in advance, for your support!
    Hi,

    The SQLCODE seems to be included with each SQL Statement topic in the
    Info Center. For example, the V8 Insert statement has them in it:



    Is this what you are looking for?

    Louise McNicoll
    DB2 Information Development

    Comment

    • BugleBoy

      #3
      Re: Matching SQLCODES to SQL Statements

      Hi,
      >
      The SQLCODE seems to be included with each SQL Statement topic in the
      Info Center. For example, the V8 Insert statement has them in it:
      >
      http://publib.boulder.ibm.com/infoce...ic/com.ibm.db2...
      >
      Is this what you are looking for?
      >
      Louise McNicoll
      DB2 Information Development
      Well ... it has some SQLSTATE codes for some specific conditions
      like ..."If the result table is empty, SQLCODE is set to +100 and
      SQLSTATE is set to '02000'."

      But, is there a table or display which lists the probable SQLCODEs for
      a specific statment, with out reading the whole explanation of the
      usage of the statement.

      Thanks for your help so far Louise!

      Comment

      • Serge Rielau

        #4
        Re: Matching SQLCODES to SQL Statements

        Bugleboy,

        The SQL Reference manual typically lists SQLSTATEs.
        Can you use these instead? SQLCODE are less portable across vendors.

        Cheers
        Serge
        --
        Serge Rielau
        DB2 Solutions Development
        IBM Toronto Lab

        Comment

        • louisem

          #5
          Re: Matching SQLCODES to SQL Statements

          On Dec 3, 5:33 pm, BugleBoy <dfaill...@gmai l.comwrote:
          >
          Well ... it has some SQLSTATE codes for some specific conditions
          like ..."If the result table is empty, SQLCODE is set to +100 and
          SQLSTATE is set to '02000'."
          >
          But, is there a table or display which lists the probable SQLCODEs for
          a specific statment, with out reading the whole explanation of the
          usage of the statement.
          >
          Thanks for your help so far Louise
          Hi, I checked with our other writers and we don't have such a table or
          list. The best suggestion that I got for you was that you can perhaps
          use the search feature to return all the statements with a specific
          code or state.

          Regards,

          Louise McNicoll
          DB2 Information Development

          Comment

          • Dan van Ginhoven

            #6
            Re: Matching SQLCODES to SQL Statements


            "BugleBoy" <dfaillace@gmai l.comwrote in message
            news:1aaf380d-fb3c-4ec6-9322-8936b1ffbba9@w3 4g2000hsg.googl egroups.com...
            Is there a guide, pamphlet, book, website, PDF or scroll somewhere
            which states the SQLCODES which are valid for each SQL statement
            (i.e., INSERT, CALL, FETCH, DECLARE CURSOR) in IBM DB2 (v7 or 8)?
            >
            I sometimes fall into the situation where someone has coded (or not) a
            questionable EVALUATE SQLCODE statement after an EXEC SQL statement.
            >
            Thanks to all of you, in advance, for your support!
            You can make an extract from "Message Reference Vol.2" db2m2e90.pdf and
            create a cross reference
            for sqlstates vs sqlcodes.
            /dg


            Comment

            Working...