File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and the fly likes TYPE DEFAULT ' '   help! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "TYPE DEFAULT Watch "TYPE DEFAULT New topic
Author

TYPE DEFAULT ' ' help!

bo shen
Greenhorn

Joined: Jul 17, 2002
Posts: 4
Hello, I am trying to call a stored procedure in oracle database via EJB.
There is one IN paramater in the procedure(i dont remmeber the exact syntex but similiar to this):
CREATE OR REPLACE PROCEDURE HELP_ME ...etc..
somename IN table.field%TYPE DEFAULT ' '
table.field has a CHAR or VARCHAR datatype.
My question is what exactly does TYPE DEFAULT ' ' mean??

When i call the procedure via sql query:
{call HELP_ME(' ')}, it returns all the nice results and works perfectly.
But when I try to call it via EJB ( all my ejb codes are correct, they worked for all other procedures just fine):
CallableStatement cs = con.prepareCall("{call HELP_ME(?,?)}");
cs.setString(1,""); also tried cs.setString(1," ");
...etc..

It returns back 0 results, no errors just no records found. But if i do {call HELP_ME(' ')} from sqlquery it returns back lots records. Why is this happening? i just cannot figure out, please help! Thank you.
Bo
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: TYPE DEFAULT ' ' help!