This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
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: 63208


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

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link:
subject: Sending NULL to an Oracle procedure.
It's not a secret anymore!