This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan 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


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
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: 60806
    
  65

Give

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

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
Consider Paul's rocket mass heater.
 
subject: Sending NULL to an Oracle procedure.
 
Similar Threads
Set Chained OFF error while executing from my Bean
java.lang.ClassCastException when invoking jdbc stored procedure call
Stored Procedure Problem
Problem with Pl/Sql function when calling in java
Passing variables