Meaningless Drivel is fun!
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

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...
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63839


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

[Asking smart questions] [About Bear] [Books by Bear]
I agree. Here's the link:
subject: Sending NULL to an Oracle procedure.
It's not a secret anymore!