If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > How to input null parameter for stored procedure

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-07-04, 14:27
bbfung bbfung is offline
Registered User
 
Join Date: Nov 2003
Posts: 18
How to input null parameter for stored procedure

Here is my store procedure:
CREATE PROCEDURE mysp
(
IN piRptCode VARCHAR(5),
IN piFilter VARCHAR(100),
OUT poMthFilter VARCHAR(10000),
OUT poPortFilter VARCHAR(10000),
OUT poType1 VARCHAR(100),
OUT poType2 VARCHAR(100),
OUT poCondition1 VARCHAR(100)
)
LANGUAGE SQL

How can I call my store procedure from the command line with piFilter as null?
I have tried
db2 call mysp('L005',,?,?,?,?,?)
or
db2 call mysp('L005','',?,?,?,?,?)
but both calls give me SQL0104N
db2 call mysp('L005',' ',?,?,?,?,?)
This works fine.

Thx in advance.
Reply With Quote
  #2 (permalink)  
Old 01-07-04, 16:33
nidm nidm is offline
Registered User
 
Join Date: May 2003
Posts: 113
Re: How to input null parameter for stored procedure

could you please try:
db2 call mysp('L005',NULL,?,?,?,?,?)


Quote:
Originally posted by bbfung
Here is my store procedure:
CREATE PROCEDURE mysp
(
IN piRptCode VARCHAR(5),
IN piFilter VARCHAR(100),
OUT poMthFilter VARCHAR(10000),
OUT poPortFilter VARCHAR(10000),
OUT poType1 VARCHAR(100),
OUT poType2 VARCHAR(100),
OUT poCondition1 VARCHAR(100)
)
LANGUAGE SQL

How can I call my store procedure from the command line with piFilter as null?
I have tried
db2 call mysp('L005',,?,?,?,?,?)
or
db2 call mysp('L005','',?,?,?,?,?)
but both calls give me SQL0104N
db2 call mysp('L005',' ',?,?,?,?,?)
This works fine.

Thx in advance.
Reply With Quote
  #3 (permalink)  
Old 01-07-04, 16:40
bbfung bbfung is offline
Registered User
 
Join Date: Nov 2003
Posts: 18
It works. thx.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On