aspose file tools*
The moose likes JSP and the fly likes Sending NULL to an Oracle procedure. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "Sending NULL to an Oracle procedure." Watch "Sending NULL to an Oracle procedure." New topic
Author

Sending NULL to an Oracle procedure.

George Larry
Ranch Hand

Joined: Nov 07, 2001
Posts: 52
How can I send NULL to an Oracle procedure?
I have something like this:
cs = con.prepareCall ( "{ call myProc( ?, ? )}" );
cs.registerOutParameter( 1, oracle.jdbc.driver.OracleTypes.CURSOR );
if ( myVar.equals( "" ) ) cs.setString( 2, NULL );
else cs.setString( 2, myVar );
To this point I've been unsuccessful in making myVar = NULL so I thought I'd try it this way... Of course, NULL isn't a variable so I can't do it like I showed above... but I shared it with you so you can get an idea of what I'm trying to do.
Please help me out...
Thanks.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61654
    
  67

Give

a try.
hth,
bear
[ April 24, 2002: Message edited by: Bear Bibeault ]

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Sending NULL to an Oracle procedure.