Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.tools -> Re: Help! How to insert an empty string without converting to null

Re: Help! How to insert an empty string without converting to null

From: Walter T Rejuney <BlueSax_at_Unforgetable.com>
Date: Tue, 03 Oct 2000 10:42:40 -0400
Message-ID: <39D9F05F.D1B7830B@Unforgetable.com>

Sybrand Bakker wrote:

> On Fri, 29 Sep 2000 17:44:24 -0700, "Igor Shmulevich"
> <igors_at_csd.uwm.edu> wrote:
>
> >I am using JDBC to insert data into Oracle and MS SQL 7 databases. One of
> >the major differences is that when I pass an empty string (e.g., String str
> >= "") to MS SQL it does exactly what is expected - inserts a blank string
> >into the database. Oracle, however, inserts a null value instead. So, when
> >the data is retrieved, one can see str = null, rather then str = "".
> >
> >I hope this is just the default behavior for Oracle and it can be changed.
> >The question is how?
> >
> >Thanks in advance,
> >
> >Igor
> >
> Oracle doesn't differentiate between empty strings and NULL.
> So yes this is the default behavior
> and NO it can not be changed.
> You can either
> a) submit an enhancement request by means of an ITAR
> b) learn to live with it
> c) stick to sqlserver

I'll add to this that even though this is the present behavior, even Oracle acknowledges that this is not consistant with ISO/ANSI standards. Ever since V6 they have been threatening to change this behavior to be consistant with the standard which specifies that an empty string must be treated separately from a null value.

I suspect that when the behavior change does come there will also be a new init.ora parameter which will determine whether it follows the ANSI standard or the legacy behavior since there is tons of code that is written for the legacy behavior. Received on Tue Oct 03 2000 - 09:42:40 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US