Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to use IBM_DB with older versions of DB2?
    primarykey
    data
    text
    <p>I want to connect Python to DB2 version 9.1 using IBM DB2 ODBC Driver.</p> <p>Following is my code to connect Python to DB2. This program is working in the later versions of IBM DB2.</p> <pre><code>import ibm_db conn = ibm_db.connect("DSN=PDB2;DRIVER={IBM DB2 ODBC DRIVER};DATABASE=MDBASIS;PORT=1234;PROTOCOL=TCPIP;UID=username;PWD=password","","") stmt = ibm_db.exe_immediate(conn,"create table egg (ID SMALLINT, NAME VARCHAR(30))") stmt = ibm_db.exe_immediate(conn,"insert into egg (ID, NAME) VALUES('1','ok')") state = ibm_db.exe_immediate("select * from egg") result = ibm_db.fetch_both(state) while result != False: print 'id = %d and name = %s' %(result[0],result[1]) result = ibm_db.fetch_both(state) stmt = ibm_db.exe_immediate(conn,"drop table egg") </code></pre> <p>My problem is, the version of my IBM DB2 is 9.1 without FixPack and I get an error message when I try to connect to IBM DB2 9.1 version.</p> <pre><code>"[IBM][CLI Driver] CLI0133E Option type out of range. SQLSTATE=HY092 SQLCODE=-99999" </code></pre> <p>And the explanation for this error written in page <a href="http://programmingzen.com/2008/02/08/essential-guide-to-the-ruby-driver-for-db2/is" rel="nofollow">http://programmingzen.com/2008/02/08/essential-guide-to-the-ruby-driver-for-db2/is</a>: "If you get this error, it usually means that you are using a version of DB2 that is too old. Install the latest FixPack or the latest version of DB2 (currently 9.5) to resolve the problem."</p> <p>But I cannot install latest FixPack or the latest version of DB2 or in any way modify existing DB2 installation.</p> <p><strong>Question</strong></p> <p>Is there any way I can connect to DB2 version 9.1 without modifying the database, possibly using something else than IBM_DB?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload