Symptom
Application migrated from PowerBuilder 9.02 to PowerBuilder 2017 connecting to MS SQL Server.
In PowerBuilder 9.02, the application used the MSS driver and in PowerBuilder 2017 using the SNC driver.
A DataWindow references a stored procedure that returns a text datatype that now in PowerBuilder 12.5.2 does not display the value unless the datatype is 32767.
The DataWindow returns a char(1000).
This worked in PowerBuilder 9.02. In order to make the code return a value we would have to modify hundreds of data windows changing the datatype on each Note, this issue appears to affect XML and varchar(max) datatypes as well.
Environment
PowerBuilder
MS SQL Server
Reproducing the Issue
1. In PowerBuilder, connect to MS SQL Server using the SNC driver.
2. In the database painter, ISQL view, create a stored procedure that returns a text datatype resultset.
3. Create a new DataWindow using the stored procedure, that you just created, as the datasource.
4. In the column specification view, change the text datatype length from 32767 to 1000.
5. Now try to retrieve the data and it will not retrieve the text datatype. It will retrieve the other columns.
Cause
From the PowerBuilder online help for StaticBind:
If your DataWindow object or report and DBMS result set descriptions do not match and you want to avoid errors, set StaticBind to 0 or No to specify that PowerBuilder should always get a result set description before retrieving data into a DataWindow object or report.
Solution
Workaround:
Set the dbparm of StaticBind=0. However, that caused the following error:
Select Error: Column lists do not match.
In order to avoid this error message, set the following dbparms:
NoCheckNullBind=1,StaticBind=0