Java Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingJava Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old July 9th, 2004, 06:40 PM
mlotspe mlotspe is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2004
Posts: 1 mlotspe User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Help with calling an Oracle 9i Stored Procedure

I've got a problem calling a Oracle 9i Stored Procedure. Here's a code snippet of what I'm doing.

Here's the Oracle 9i function variable description:

(Result) BOOLEAN
ID1 Number(9) IN
ID2 VarChar2 IN
BillRec RECORD IN OUT
ErrCode VarChar2 IN OUT
ErrMSG VarChar2 IN OUT

Here's my Java Code:

CallableStatement pstmt = conn.prepareCall("{?=call MyFunction(?,?,?,?,?,?)}");


pstmt.registerOutParameter(1,OracleTypes.BOOLEAN);
pstmt.setLong(2, ID1); // input parameter
pstmt.setString(3, ID2); // input parameter


pstmt.registerOutParameter(4,OracleTypes.CURSOR);
pstmt.registerOutParameter(5,Types.CHAR);//error code
pstmt.registerOutParameter(6,Types.CHAR);//error message
pstmt.executeQuery();

The error is 1008ORA-01008: not all variables bound

I've tried many variations and the error messages vary. But the above seems the most logical syntax to me but evidently, wrong.

Any help would be greatly appreciated as I'm really stumped!!

Reply With Quote
  #2  
Old August 11th, 2004, 12:01 PM
smitam smitam is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Aug 2004
Posts: 2 smitam User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Hi,
I was wondering if you have already resolved this problem . Looking at your
Procedure and the java call to the procedure ,the procedure has only 5 parameters while you have 6
"?" in the parameter sec. of your java call to the procedure.
thanks
Bye

Quote:
Originally Posted by mlotspe
I've got a problem calling a Oracle 9i Stored Procedure. Here's a code snippet of what I'm doing.

Here's the Oracle 9i function variable description:

(Result) BOOLEAN
ID1 Number(9) IN
ID2 VarChar2 IN
BillRec RECORD IN OUT
ErrCode VarChar2 IN OUT
ErrMSG VarChar2 IN OUT

Here's my Java Code:

CallableStatement pstmt = conn.prepareCall("{?=call MyFunction(?,?,?,?,?,?)}");


pstmt.registerOutParameter(1,OracleTypes.BOOLEAN);
pstmt.setLong(2, ID1); // input parameter
pstmt.setString(3, ID2); // input parameter


pstmt.registerOutParameter(4,OracleTypes.CURSOR);
pstmt.registerOutParameter(5,Types.CHAR);//error code
pstmt.registerOutParameter(6,Types.CHAR);//error message
pstmt.executeQuery();

The error is 1008ORA-01008: not all variables bound

I've tried many variations and the error messages vary. But the above seems the most logical syntax to me but evidently, wrong.

Any help would be greatly appreciated as I'm really stumped!!

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingJava Development > Help with calling an Oracle 9i Stored Procedure


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway
Stay green...Green IT