Title: How is it possible to insert a NULL into an ORACLE TABLE when host variable has been initialized?

To achieve this goal, you have to use the indicator variables:


      *Put a NULL value in a record using indicator variables
           move 6      to V-KEY
           move spaces to V-DATA
           move -1     to IND-VAR
           EXEC SQL INSERT INTO V_TABLE VALUES (:V-KEY, :V-DATA:IND-VAR) 
           END-EXEC

When the value of the indicator variable is equal to -1, the value of the host variable is ignored and NULL will be used, instead.
All info related to the indicator variable are available at the isCOBOL documentation in the 'Language Reference Manual-> Embedded SQL-> Indicator Variables' chapter.
Authored by: Veryant Support on Fri, Nov 22nd, 2013 at 7:00 PM
This question has been viewed 5797 times so far.
Online URL: http://support.veryant.com/support/phpkb/question.php?ID=221

Powered by PHPKB Knowledge Base Software