Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: JDBC Driver setObject() converts empty string to NULL
Thomas Kellerer wrote:
>
> On 31.05.2006 10:08 Robert Klemme wrote:
>> Vladimir M. Zakharychev wrote: >>> Hmm... Not exactly clear what the problem is, but I'll try: >>> in Oracle, empty strings *are* NULLs. This is known and >>> documented behavior. setString() or setObject() probably >>> convert empty strings to NULLs because they are the >>> same thing in Oracle. You need to code for this behavior >>> as it can't be turned off. >> >> Thanks for the hint. I can't believe that this slipped by me until >> now. For interested parties, here is a simple test: >>
Oh, please stop it. I'm embarrassed enough that I didn't know it. :-}
> Interesting enough they claim "this may not continue to be true in
> future releases". But this has been true since Oracle 7 up to 10 and I
> don't really believe this will be changed ;)
Doesn't look like it would although they say "... and Oracle recommends that you do not treat empty strings the same as nulls."
Shudder
robert Received on Wed May 31 2006 - 04:39:23 CDT