field_len result error



IBM's flagship relational database management system

field_len result error

Postby curt » Sat Jul 15, 2023 12:47 am

I am using PHP and ODBC to connect to DB2 on my Power 9 in an effort to copy some tables from a DB2 database to a MYSQL database.
I am using a PHP script that i wrote years ago that worked great. I haven't used it in a few years.
In that time, we got a new webserver and have upgraded the OS of the as400/iseries/poweri so im not sure if one of those things is causing it to fail now.

the failure is happening when i use odbc_field_precision or odbc_field_len to return the size of the fields/columns for a table.
I am getting a huge number like 2503965933569 for the field size. i noticed the number changes based on the correct field size.

for example, is the number i get is 11111111 and the actual field size is 4, the number will say 11111115.
if the next field size is 8, the number will be 11111119. The correct field size is being added to a number and i dont know what that number is or how to predict it.
I have tried changing many settings on the ODBC driver but haven't found a setting that fixed it.

thanks in advance for any advice or solution you can offer.
curt
 
Posts: 1
Joined: Sat Jul 15, 2023 12:36 am
Has thanked: 0 time
Been thanked: 0 time

Return to DB2

 


  • Related topics
    Replies
    Views
    Last post