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 JDBC and the fly likes Calling a function vs a procedure on Oracle with CallableStatement 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 » Databases » JDBC
Bookmark "Calling a function vs a procedure on Oracle with CallableStatement" Watch "Calling a function vs a procedure on Oracle with CallableStatement" New topic
Author

Calling a function vs a procedure on Oracle with CallableStatement

Tim Vries
Greenhorn

Joined: Nov 29, 2001
Posts: 8
Is it possible to call a function with CallableStatement vs calling a stored procedure? If not, is there another way to do this?
When I try to execute the following code :
String xyz = "{call TEST_FUNCTION(?,?)}";
cs = conn.prepareCall(xyz);
cs.setString(1, "XYZ");
cs.registerOutParameter(2,Types.VARCHAR);
cs.execute();
... I get the following error from the database:
Sql Exception : java.sql.SQLException: ORA-06550: line 1, column 7:
PLS-00221: 'TEST_FUNCTION' is not a procedure or is undefined
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored
 
 
subject: Calling a function vs a procedure on Oracle with CallableStatement
 
Similar Threads
Oracle9i wrong number or types of arguments in call to...
help:java.sql.SQLException: ORA-06550
PLS-00201: identifier 'SEC_LBIC.LDAP_VIEW_APP_LIST' must be declared
Urgent
java ORA-06550 PLS-00801