Results 1 to 6 of 6
  1. #1
    Join Date
    Jan 2003
    Location
    Germany
    Posts
    7

    Red face Unanswered: DB2 8.1 on Linux: ODBC problem

    Hi!

    I have serious problems getting an odbc connection to a db2 database.

    I am running version 8.1 on a linux box. I used the tool db2ca to bind odbc driver to the database "sample" - and I don't know if I did anything right.
    I started "db2" from /home/db2inst1/sqllib/bnd, made a connection to sample and entered
    bind @db2ubind.lst messages /tmp/bind.msg grant public
    bind @db2cli.lst messages /tmp/clibind.msg grant public

    There are warnings:
    LINE 235 SQL0440N No authorized routine named "POSSTR" of type
    "FUNCTION" having compatible arguments was found.
    SQLSTATE=42884

    Anyway I installed unixodbc, got the iSeries drivers from ibm, configured manually the files odbcinst.ini and odbc.ini, but the odbctest utility crashes with segmentation fault. I also tried libodbc.so in /opt/IBM/db2/V8.1/odbc/lib/, it crashes too.

    Maybe it is because of the params for the odbc connection, I could not find any information about it. I tried in odbc.ini:

    [sample1]
    Driver = /opt/ibm/iSeriesODBC/lib/libcwbodbc.so
    ServerDB = sample
    ServerNode = localhost

    [sample2]
    Driver = /opt/IBM/db2/V8.1/odbc/lib/libodbc.so
    DSN = sample2
    System = localhost
    ServerDB = sample
    ServerNode = localhost
    Database = sample

    I tried "odbctest sampleX db2inst1 password" and also run a test program (written in ruby, which works with postgres and oracle over odbc).

    Unixodbc is working right, I got an odbc connection with a postgresql database (the params for odbc.ini are well documented). I guess the db2 odbc driver is the wrong one, or it is a bug in there.

    Does anyone got it working (or does know the odbc.ini params for db2)??!
    Why is db2 so bad documented (version 8.1 too new)??

    TIA, Oliver.

  2. #2
    Join Date
    Aug 2001
    Location
    UK
    Posts
    4,650

    Re: DB2 8.1 on Linux: ODBC problem

    LINE 235 SQL0440N No authorized routine named "POSSTR" of type
    "FUNCTION" having compatible arguments was found.
    SQLSTATE=42884


    Can you post the line 235 in the script .

    Are you able to successfully run the same from a command line ...

    I hope you would have read the following:

    http://www-1.ibm.com/support/docview...id=swg21079056

    http://www.unixodbc.org/doc/db2.html

    HTH

    Cheers
    Sathyaram


    Originally posted by olimen
    Hi!

    I have serious problems getting an odbc connection to a db2 database.

    I am running version 8.1 on a linux box. I used the tool db2ca to bind odbc driver to the database "sample" - and I don't know if I did anything right.
    I started "db2" from /home/db2inst1/sqllib/bnd, made a connection to sample and entered
    bind @db2ubind.lst messages /tmp/bind.msg grant public
    bind @db2cli.lst messages /tmp/clibind.msg grant public

    There are warnings:
    LINE 235 SQL0440N No authorized routine named "POSSTR" of type
    "FUNCTION" having compatible arguments was found.
    SQLSTATE=42884

    Anyway I installed unixodbc, got the iSeries drivers from ibm, configured manually the files odbcinst.ini and odbc.ini, but the odbctest utility crashes with segmentation fault. I also tried libodbc.so in /opt/IBM/db2/V8.1/odbc/lib/, it crashes too.

    Maybe it is because of the params for the odbc connection, I could not find any information about it. I tried in odbc.ini:

    [sample1]
    Driver = /opt/ibm/iSeriesODBC/lib/libcwbodbc.so
    ServerDB = sample
    ServerNode = localhost

    [sample2]
    Driver = /opt/IBM/db2/V8.1/odbc/lib/libodbc.so
    DSN = sample2
    System = localhost
    ServerDB = sample
    ServerNode = localhost
    Database = sample

    I tried "odbctest sampleX db2inst1 password" and also run a test program (written in ruby, which works with postgres and oracle over odbc).

    Unixodbc is working right, I got an odbc connection with a postgresql database (the params for odbc.ini are well documented). I guess the db2 odbc driver is the wrong one, or it is a bug in there.

    Does anyone got it working (or does know the odbc.ini params for db2)??!
    Why is db2 so bad documented (version 8.1 too new)??

    TIA, Oliver.

  3. #3
    Join Date
    Jan 2003
    Location
    Germany
    Posts
    7

    Re: DB2 8.1 on Linux: ODBC problem

    Hi!

    First I want to thank you for helping me!

    Line 235 of the file ~/sqllib/bnd/db2ubind.lst:
    db2uipkg.bnd

    Every other line has a plus (+) behind it, e.g. "db2ulxld.bnd+".
    There's a file db2uipkg.bnd, it seems to be quasi binary (starts with "BINDV810L").

    Yes I read
    http://www.unixodbc.org/doc/db2.html, but it does not cover version 8.1, but I tried that solution too. The result is:


    Operation: Enter ODBC Test Program, RETCODE = 0
    Operation: Completed Initialization, RETCODE = 0
    Operation: SQLAllocEnv, RETCODE = 0
    Operation: SQLAllocConnect, RETCODE = 0
    dsn=sample3; uid=db2inst1; pwd=xxx
    Operation: SQLConnect, RETCODE = -1
    SQLSTATE = S1000
    SQLCODE = 80

    Operation: SQLSetConnectOption (IV license), RETCODE = 0
    Operation: SQLSetConnectOption (IV password, RETCODE = 0
    Operation: Environment settings written to $(VWS_LOGGING)/odbctest.set, RETCODE
    = 0

    *** General Informaion ***
    Error SQLAllocStmt,-1.
    SQLGetInfo is not supported!
    Operation: SQLAllocStmt, RETCODE = -1
    SQLSTATE = 01000
    SQLCODE = 0
    Error Message:

    Table type=TABLE
    Operation: SQLFetch, RETCODE = -2
    @QLSTATE = XS
    SQLCODE = 0
    Error Message:
    TX'@
    Operation: SQLDisconnect, RETCODE = -1
    SQLSTATE = 01000
    SQLCODE = 0
    Error Message:

    Operation: Exit ODBC Test Program, RETCODE = 0


    The second link http://www-1.ibm.com/support/docview...id=swg21079056 seems to be what I was looking for. Thank you very much.

    But there are still (the same) problems.
    They say I should use db2.o for version 8 (under 4.2.2), but I don't have this file, only libdb2.so (and only .so files at all). If I use libdb2.so I get the same like shown above with one exception (the first block):


    Operation: SQLConnect, RETCODE = -1
    SQLSTATE = S1000
    SQLCODE = 364
    Error Message:



    After one week trying to get this running, I think I will give it up, don't buy db2 and advise my customer to get something else...

    Or do you have another idea?!

    TIA, Oliver.

  4. #4
    Join Date
    Jan 2003
    Location
    Germany
    Posts
    7

    Re: DB2 8.1 on Linux: ODBC problem

    Hi!

    After experimenting with my ruby application I got the following result:

    Driver: /home/db2inst1/sqllib/lib/libdb2.so
    Result: [unixODBC][Driver Manager]Driver's SQLAllocHandle on SQL_HANDLE_HENV failed

    Driver: /home/db2inst1/sqllib/odbc/lib/libodbc.so
    Result: Segmentation fault

    Driver: /opt/ibm/iSeriesODBC/lib/libcwbodbc.so
    Result: [unixODBC][IBM][iSeries Access ODBC Driver]Missing system name needed for connection.

    The first drivers error message could be because of the bind problem (see warnings in my first message).
    The second drivers non-message could be because ... whatever, maybe the right driver, but buggy.
    The third drivers error message could be because of the wrong driver! I really don't know what iSeries could mean, and what the system parameter could be for.

    Any more suggestions?!

    TIA, Oliver.

  5. #5
    Join Date
    Aug 2001
    Location
    UK
    Posts
    4,650

    Re: DB2 8.1 on Linux: ODBC problem

    Another link to help you

    http://www-3.ibm.com/software/data/d...i/r0007866.htm

    asks you to ignore the sql0440 error you get ..

    HTH

    Cheers

    Sathyaram


    Originally posted by olimen
    Hi!

    After experimenting with my ruby application I got the following result:

    Driver: /home/db2inst1/sqllib/lib/libdb2.so
    Result: [unixODBC][Driver Manager]Driver's SQLAllocHandle on SQL_HANDLE_HENV failed

    Driver: /home/db2inst1/sqllib/odbc/lib/libodbc.so
    Result: Segmentation fault

    Driver: /opt/ibm/iSeriesODBC/lib/libcwbodbc.so
    Result: [unixODBC][IBM][iSeries Access ODBC Driver]Missing system name needed for connection.

    The first drivers error message could be because of the bind problem (see warnings in my first message).
    The second drivers non-message could be because ... whatever, maybe the right driver, but buggy.
    The third drivers error message could be because of the wrong driver! I really don't know what iSeries could mean, and what the system parameter could be for.

    Any more suggestions?!

    TIA, Oliver.

  6. #6
    Join Date
    Jan 2003
    Location
    Germany
    Posts
    7

    Re: DB2 8.1 on Linux: ODBC problem

    Hi!

    So I know that my problem is not because of the bind problem.
    Do you know someone who got DB2 8.1 running on linux with ODBC?!
    Or is there another source for ODBC driver files for DB2?

    TIA, Oliver.

    Originally posted by sathyaram_s
    Another link to help you

    http://www-3.ibm.com/software/data/d...i/r0007866.htm

    asks you to ignore the sql0440 error you get ..

    HTH

    Cheers

    Sathyaram

Posting Permissions

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