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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts Compile Several JCL JOB Through one r... CLIST & REXX 4
No new posts Running REXX through JOB CLIST & REXX 13
No new posts Error to read log with rexx CLIST & REXX 11
No new posts isfline didnt work in rexx at z/OS ve... CLIST & REXX 7
No new posts run rexx code with jcl CLIST & REXX 15
Search our Forums:

Back to Top