Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Sending NULL to an Oracle procedure.

 
George Larry
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 64827
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Give

a try.
hth,
bear
[ April 24, 2002: Message edited by: Bear Bibeault ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic