Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes Oracle/OAS and the fly likes How to use IN OUT parameter Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Oracle/OAS
Bookmark "How to use IN OUT parameter" Watch "How to use IN OUT parameter" New topic
Author

How to use IN OUT parameter

Sarath Mohan
Ranch Hand

Joined: Mar 17, 2001
Posts: 213
I have stored procedure where I want to pass one value to the Stored procedure get another value after the execution of the procedure. I used IN OUT parameter in the Stored procedure.

And used the followin code


New element number always comes as -2.
I should pass -2 for some kind of checking in side stored procedure.
after execution this parameter should contain the new Number.

Am I doing wrong anywhere?
Please help

Sarath


Sarath Mohan
Avi Abrami
Ranch Hand

Joined: Oct 11, 2000
Posts: 1135

Sarath,
Works for me using Oracle 9i (9.2.0.4.0) on SUN [sparc] Solaris 9, JDK 1.5.0_04 and the latest Oracle JDBC driver: ojdbc14.jar

First, the definition of my [PL/SQL] procedure:

And now, my java code for invoking the P0 procedure:

Good Luck,
Avi.
[ September 19, 2005: Message edited by: Avi Abrami ]
Mike Rainville
Ranch Hand

Joined: May 29, 2004
Posts: 36
Originally posted by Sarath Mohan:



What happens if you change call. to callStmt. ?
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: How to use IN OUT parameter