SQL statement for nullable columns

The IRD issues SQL insert and update calls.

When you are processing a nullable column, you must specify a null indicator variable in the VALUES clause of your insert statement. Here is an example:
EXEC SQL
       INSERT INTO TB_MYFILE (
              MYFILE_KEY,
              MYFILE_COL1,
              MYFILE_COL1,
              MYFILE_COL3)
       VALUES (
              :HV-KEY,
              :HV-COL1,
              :HV-COL2,
              :HV-COL3:HVNULL-IND)
The column MYFILE_COL3 is nullable. The working storage variable HVNULL-IND is the null indicator field. A value less than 0 will result in a null value for this insert.

Concept Concept

Feedback


Timestamp icon Last updated: Monday, 10 February 2014


http://pic.dhe.ibm.com/infocenter/cicsts/v5r1/topic/com.ibm.cics.vt.doc//topics/cvtdecSQLStatementForNullableColumns.html