Skip to main content
Apr 12, 2017 12:54 PM UTC

PDO DB2 and VARCHAR more than 255 characters

Hi,

We want to use PHP to access DB2 tables with VARCHAR columns longer than 255 characters.

When a SELECT query is executed, the value of a VARCHAR column of more than 255 characters is not returned …

By enabling a trace in the DSNAOINI configuration (APPLTRACE = 1 and APPLTRACEFILENAME = path), we find that the SQLGetData statement returns an SQL_ERROR when accessing this column.

Is this a limitation of the ODBC driver? Of PDO?
Is there a way to circumvent this limitation?

Thank you in advance for your help.

Regards,

Denis

2 replies

May 27, 2018 4:20 PM UTC

Hi,

We want to use PHP to access DB2 tables with VARCHAR columns longer than 255 characters.

When a SELECT query is executed, the value of a VARCHAR column of more than 255 characters is not returned …

By enabling a trace in the DSNAOINI configuration (APPLTRACE = 1 and APPLTRACEFILENAME = path), we find that the SQLGetData statement returns an SQL_ERROR when accessing this column.

Is this a limitation of the ODBC driver? Of PDO?
Is there a way to circumvent this limitation?

Thank you in advance for your help.

Regards,

Denis

Hi

I have got the same problem and it is a real showstopper for me.
I know this is not a limitation of ODBC or PDO, because the IBM ported tools did work with long varchar’s.
Wonder if this is fixed or will be fixed in the near future.

Leo

Sergey Rezepin
Rocketeer
May 29, 2018 7:37 AM UTC

Hi,

We want to use PHP to access DB2 tables with VARCHAR columns longer than 255 characters.

When a SELECT query is executed, the value of a VARCHAR column of more than 255 characters is not returned …

By enabling a trace in the DSNAOINI configuration (APPLTRACE = 1 and APPLTRACEFILENAME = path), we find that the SQLGetData statement returns an SQL_ERROR when accessing this column.

Is this a limitation of the ODBC driver? Of PDO?
Is there a way to circumvent this limitation?

Thank you in advance for your help.

Regards,

Denis

Hi Denis and Leo,

Thanks for reporting.
The internal issue was opened for this case.

Regards,
Sergey