IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

How do I insert a Null in REXX


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Vishwamurthy

New User


Joined: 11 Mar 2008
Posts: 57
Location: India

PostPosted: Fri Jun 05, 2009 8:02 pm
Reply with quote

I am trying to insert a new row into a DB2 table.
I want one of the columns to be a NULL. I am trying to do that through a REXX executable.

Code:

"INSERT INTO AGENT VALUES ( ?, ?, ?, ?)"

and then
I am populating variables AGENTIDA, DOBA, ADDRESSA to some values
CONTACTA=NULL inserts a 'NULL' in that column
CONTACTA="" inserts a row, but the column is not a NULL
Code:

"EXECSQL EXECUTE S2 USING :AGENTIDA, :DOBA, :ADDRESSA, :CONTACTA"


If I try doing
Code:

"INSERT INTO AGENT (AGENTID, DOB, ADDRESS) VALUES (?, ?, ?)"

and then
Code:

"EXECSQL EXECUTE S2 USING :AGENTIDA, :DOBA, :ADDRESSA"


I get an error in insert
Code:

SQLCODE -518 
SQLSTATE 07003


Can anyone guide me in this regard?

Thanks in advance.
Back to top
View user's profile Send private message
Vishwamurthy

New User


Joined: 11 Mar 2008
Posts: 57
Location: India

PostPosted: Fri Jun 05, 2009 8:49 pm
Reply with quote

Thanks all. I got it using an Indicator variable with value -1
Back to top
View user's profile Send private message
View previous topic : : View next topic  
Post new topic   Reply to topic All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts Instream REXX? JCL & VSAM 13
No new posts CEMT using Rexx? Help please CLIST & REXX 3
No new posts get submitted JCL from SDSF with REXX... CLIST & REXX 2
No new posts Rexx to read current Panvalet editor/... CLIST & REXX 0
No new posts Sort to insert record in an empty file. DFSORT/ICETOOL 5
Search our Forums:


Back to Top