DB2 Connect Fails with SQLCODE 7008

  • Megala

    Megala - 2009-06-23


    We are trying to perform DB2 connect through rexx using SQLEXEC. We are using Windows authentication for DB2. Hence if I pass my windows log on id, which is greater than 8 characters, I'm getting SQLCODE -7008.

    Following is the screen output
    14:02:38 Initialising...
    14:02:38 Connecting to IUFEU1 User: mvinayagam Password: ****

    DB2 Library where the error occurs sqlarf_g

    SQLCA.SQL7008N REXX variable "mabcdefghi" contains inconsistent data.

    14:02:38 --- Error Report ---
    14:02:38 ERROR occurred : CONNECTING
    14:02:38 SQLCODE : -7008
    14:02:38 ERRMSG
    14:02:38 --- End Error Report ---


    Following is the code snippet
    call logInfo "M" "Connecting to "db" User: "dbuser" Password: ****"
    call SQLEXEC "CONNECT TO "db" USER mabcdefghi USING xxxxxxxxxxx"
    SAY "DB2 Library where the error occurs " SQLCA.SQLERRP
    call checkErr "C" "Connecting" sqlca.sqlcode
    call logInfo "M" "Connected."
    call logInfo "M" " "

    Any help in this regard will be truly appreciated.


    • Mark Harsen

      Mark Harsen - 2009-06-23

      I'm not a DB2 guru and I connect to DB2 a bit differently so I can't help with the above code, but I can show you what works for me and hope that it helps:

      Rc = SQLCONNECT(ConnectionName, Username, Password, DataSourceName, "")

      If Rc = 0, you have a good connection. If it is negative, it means an error occurred, but I've only seen errors between -1 and -97. I installed IBM's DB2 ODBC drivers and specify the correct Data Source Name to get this to work. Then I can run any queries, updates, etcetera I like without issues usually using SQLCOMMAND or SQLPREPARE. Then I close the database using SQLDISCONNECT(ConnectionName). I hope this helps some...

      Good Luck! -Mark

      • Nobody/Anonymous

        Thanks Mark. It worked after copying REXXSQL related dlls.



Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.

No, thanks