Connection Information

To perform the requested action, WordPress needs to access your web server. Please enter your FTP credentials to proceed. If you do not remember your credentials, you should contact your web host.

Connection Type

DB2 INSERT to nullable column with default results in Assignment of a NULL value to a NOT NULL column error – PB Docs 2022 – PowerBuilder Library

DB2 INSERT to nullable column with default results in Assignment of a NULL value to a NOT NULL column error – PB Docs 2022

DB2 INSERT to nullable column with default results in Assignment
of a NULL value to a NOT NULL column error

Symptom

Upgraded the DB2 database from ZOS to LUW.

Performing an INSERT on a table that has a column that allows
nulls and is defined WITH DEFAULT ‘n’ results in the following
error:

Environment

PowerBuilder

Reproducing the Issue

Do the following to reproduce this issue:

1.  Set up pbtrace on the connection to the database.  This can be
done either of the following two ways:

A. Add TRACE to the database connection parameters: 
SQLCA.DBMS=”TRACE ODBC”

B.  Select “Generate Trace” in the Connection tab of the database
profile setup window in PowerBuilder:

2.  Set the database parameter DisableBind=1.

3.  PBSupportBindUpdate=’YES’ is entered in the appropriate DB2
section of the pbodbxxx.ini file.  For example:

4.  Test the INSERT and it will fail with the Assignment of a NULL
value to a NOT NULL column error message.

Cause

This problem is caused by the database trying to use bind
variables because PBSupportBindUpdate=’YES’ is in the pbodbxxx.ini
file.

Solution

In most cases setting PBSupportBindUpdate=’NO’ in the
pbodbxxx.ini should solve the problem.  However, there may be times when
it doesn’t. For those instances do the following:

Add DescribeParm=0 to the db2cli.ini file.


Document get from Powerbuilder help
Thank you for watching.
Was this article helpful?
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x