Null values can cause SQLstate 22002

Expand / Collapse
 
     

Null values can cause SQLstate 22002


It is possible to create customs which allow null values. When nulls are present they can cause a NetExpress (Microfocus COBOL) program to error out with a SQLstate 22002 error. The error message "indicator variable required but not supplied" is less than helpful. There is however a Microsoft knowledge base article which explains the error in more detail.

To workaround this issue in Oracle you can use the decode function in the select statement such that nulls are changed to spaces as shown below:

               SELECT
                   EM_EMPLOYEE_ID,
                   decode(RATE_TABLE_GRADE,NULL,'     ',
                          RATE_TABLE_GRADE) as rateGrade

                   . . .



Add Your Comments


Name: *
Email Address:
Web Address:
Verification Code:
*
 

Details
Last Modified:Sunday, February 08, 2009
Last Modified By: Denton Harryman
Type: HOWTO
Article not rated yet.
Article has been viewed 788 times.
Options