Home » Developer & Programmer » Precompilers, OCI & OCCI » Urgent : Setting Null value of a COBOL variable
Urgent : Setting Null value of a COBOL variable [message #93657] Tue, 17 September 2002 23:32 Go to next message
Neetika
Messages: 1
Registered: September 2002
Junior Member
hi,

I just want to know if it is possible to set value of a varaible as Null
Reference to any Cobol manual/tutorial wil also do .

Reply asap.
Regards,
Neetika
Re: Urgent : Setting Null value of a COBOL variable [message #93790 is a reply to message #93657] Mon, 20 January 2003 08:56 Go to previous message
Thotakura
Messages: 9
Registered: January 2003
Junior Member
Yes,

U can set null values. for that u have to pass an indicator variable along with the host variable.

if that indicator value is '0' then the value of that coloumn will be set to NULL and it will ignore the value in the host variable.

ex:

EXEC SQL BEGIN DECLARE SECTION;
VARCHAR hostvar;
int indvar;
EXEC SQL END DECLARE SECTION;

EXEC SQL INSERT INTO SOMETABLE VALUES(:hostvar,:indvar);

if u have any problem with this mail me
Previous Topic: Running a ProC exe file
Next Topic: EXEC SQL 'hangs' on insert
Goto Forum:
  


Current Time: Mon May 27 12:02:13 CDT 2024