This week's book giveaway is in the Performance forum.
We're giving away four copies of The Java Performance Companion and have Charlie Hunt, Monica Beckwith, Poonam Parhar, & Bengt Rutisson on-line!
See this thread for details.
Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Calling a function vs a procedure on Oracle with CallableStatement

 
Tim Vries
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic