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 > Calling a stored procedure in DB2 8.1

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-03-06, 10:52
mburke mburke is offline
Registered User
 
Join Date: Aug 2006
Posts: 56
Calling a stored procedure in DB2 8.1

I try to call a proc like this...

call proctest(?, ?, 'doit');

The first two args are output params (DATETIME). The last is an input param (VARCHAR).

I get the following error:

Error: com.ibm.db2.jcc.a.SqlException: DB2 SQL error: SQLCODE: -313, SQLSTATE: 07004, SQLERRMC: null, SQL State: 07004, Error Code: -313

Do I have to prep the arguments in some way before I make the call?
Reply With Quote
  #2 (permalink)  
Old 10-03-06, 11:06
Marcus_A Marcus_A is offline
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,196
The -313 may be happening inside the SP. I would look up that error message in the manual and check your SP to make sure it is written properly.
__________________
M. A. Feldman
IBM Certified DBA on DB2 for Linux, UNIX, and Windows
IBM Certified DBA on DB2 for z/OS and OS/390
Reply With Quote
  #3 (permalink)  
Old 10-03-06, 11:12
mburke mburke is offline
Registered User
 
Join Date: Aug 2006
Posts: 56
The error is : The USING clause or INTO clause is required for dynamic parameters


I don't have access to the sp code
Reply With Quote
  #4 (permalink)  
Old 10-03-06, 12:21
n_i n_i is offline
:-)
 
Join Date: Jun 2003
Location: Toronto, Canada
Posts: 4,449
Quote:
Originally Posted by mburke

I get the following error:

Error: com.ibm.db2.jcc.a.SqlException: DB2 SQL error: SQLCODE: -313, SQLSTATE: 07004, SQLERRMC: null, SQL State: 07004, Error Code: -313
From the above I'm assuming you make your call from some Java code. It would help if you posted the code fragment where you make the call.
Reply With Quote
  #5 (permalink)  
Old 10-03-06, 13:19
mburke mburke is offline
Registered User
 
Join Date: Aug 2006
Posts: 56
Nope, I am not calling it from Java. I am using Squirrel SQL's SQL Worksheet. I also tried JDeveloper's sql tool and got the same results.
Reply With Quote
  #6 (permalink)  
Old 10-03-06, 15:20
Marcus_A Marcus_A is offline
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,196
Try it from a DB2 Command Prompt:

db2 connect to <database-name>

db2 "call proctest(?, ?, 'doit')"
__________________
M. A. Feldman
IBM Certified DBA on DB2 for Linux, UNIX, and Windows
IBM Certified DBA on DB2 for z/OS and OS/390
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