Results 1 to 4 of 4

Thread: sql codes

  1. #1
    Join Date
    Jan 2010
    Posts
    1

    Unanswered: sql codes

    Hi
    I am migrating a cobol-db2 program from DB2 SQL to MS SQL 2005. The sqlcodes that I have in my program are -911, -904, -913, -923. I want to know the corresponding sqlcodes in MS SQL. Could someone please help me with that? I have been trying to search for it from last 3 days...

  2. #2
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    What do those sqlcodes mean in DB2? In fact, what are sqlcode?
    Testimonial:
    pootle flump
    ur codings are working excelent.

  3. #3
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    I reckon you'd be better of telling people what those DB2 codes mean, ie what errors they signify and then try to find the similar error codes in SQL Server

    Google
    I'd rather be riding on the Tiger 800 or the Norton

  4. #4
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    These DB/2 errors are almost unheard of in well managed Microsoft SQL Server applications. Not all of them are even treated as SQL errors by the Microsoft native client.

    For reference, from the DB/2 manual:

    Code:
    SQLCODE	DESCRIPTION
    -904	UNSUCCESSFUL EXECUTION CAUSED BY AN UNAVAILABLE RESOURCE. REASON , TYPE OF RESOURCE , AND RESOURCE NAME
    -911	THE CURRENT UNIT OF WORK HAS BEEN ROLLED BACK DUE TO DEADLOCK OR TIMEOUT.  REASON , TYPE OF RESOURCE , AND RESOURCE NAME
    -913	UNSUCCESSFUL EXECUTION CAUSED BY DEADLOCK OR TIMEOUT. REASON CODE , TYPE OF RESOURCE , AND RESOURCE NAME
    -923	CONNECTION NOT ESTABLISHED: DB2 , REASON , TYPE , NAME
    -904 would be equivalent to a lock failure in SQL Server. This hasn't happened regularly since the release of SQL Server version 3 (many, many years before Microsoft bought the product)

    -911 and -913 are deadlock issues. There isn't a SQL error code for this, it is treated as a broken connection and reported as such by your COBOL library. Different compilers handle this in radically different ways, you'll have to check your COBOL documentation.

    -923 is another variation of a broken connection. A zOS COBOL program would only report this error if the bind step failed when building the executable or if DB/2 access was revoked from the bound id. This is effectively meaningless in the Microsoft SQL environment, this error would only be retunred as a result of a coding error and the error reported would vary wildly based on which COBOL library your program is using (for the same reasons that I cited in the previous paragraph).

    -PatP
    In theory, theory and practice are identical. In practice, theory and practice are unrelated.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •