This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Oracle/OAS and the fly likes new to oracle How to execute Stored Procedure Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Products » Oracle/OAS
Bookmark "new to oracle How to execute Stored Procedure" Watch "new to oracle How to execute Stored Procedure" New topic
Author

new to oracle How to execute Stored Procedure

praneeth ram
Ranch Hand

Joined: Sep 21, 2009
Posts: 60
hi all, i have the bellow stored procedure how to execute it.



> Procedure created.

No i am trying to run it
> exec myproc1 (john)

i am getting the bellow error

*


Can any one help me how to run the above one.
Thanks,
Praneeth
Ninad Kulkarni
Ranch Hand

Joined: Aug 31, 2007
Posts: 787

Try to execute below code and let us know



SCJP 5.0 - JavaRanch FAQ - Java Beginners FAQ - SCJP FAQ - SCJP Mock Tests - Tutorial - JavaSE7 - JavaEE6 -Generics FAQ - JLS - JVM Spec - Java FAQs - Smart Questions
praneeth ram
Ranch Hand

Joined: Sep 21, 2009
Posts: 60
nothing great same error we are getting.

could you please post the procedure code and execution command.

Thanks,
Praneeth
Fatih Keles
Ranch Hand

Joined: Sep 01, 2005
Posts: 182

a variable named john is looked for but can not be found.

This one will work.

Ninad Kulkarni
Ranch Hand

Joined: Aug 31, 2007
Posts: 787

@praneeth
As explained by Fatih you need to send varchar2 type parameter in procedure
praneeth ram
Ranch Hand

Joined: Sep 21, 2009
Posts: 60
Hi Ninad Kulkarni,Fatih Keles I got the solution. please find it bellow. thanks for replying.

Step:1


After creation of the above stored procedure. Now declare one bind variable in the sql prompt.

Step:2


Now call the StoredProcedure by passing the "name" and the bind variable.

Step:3


PL/SQL procedure successfully completed.
After execution of the above command the output is stored in bind variable. Now print the bind variable

Step:4

*****output********
D
---------------
sai1

So Finally i got the expected solution for the stored procedure. Ninad Kulkarni,Fatih Keles thanks for replying for my query.


 
It is sorta covered in the JavaRanch Style Guide.
 
subject: new to oracle How to execute Stored Procedure
 
Similar Threads
stored procedure mismatch
Can a oracle Stored procedure return a cursor as a return value?
HELP!!! - inner exception : java.sql.SQLException: ORA-06550:
java.sql.SQLException: Pls Help
Calling a function vs a procedure on Oracle with CallableStatement