in reply to Oracle DBI quote

Oracle's conversion of '' to NULL is a well-known problem.

Of course, other systems (Sybase for example) convert '' to ' ' (i.e. a single space) if the value is a varchar() - essentially because a zero length string is considered the same thing as NULL.

I'm pretty sure that this behavior (i.e. inability to store a zero length string) is mandated by the SQL standard. In any case it's been discussed to death on the dbi-users mailing list, and in other lists/newsgroups as well.

Michael

Replies are listed 'Best First'.
Re: Re: Oracle DBI quote
by Cine (Friar) on Oct 25, 2002 at 22:53 UTC
    Probably ;)
    However, I dont really care if there is a single space, but I cant get that to work and that is my real problem.

    T I M T O W T D I
      I think that you can do something like this (culled from the dbi-users mailing list):

      use DBD::Oracle qw( :ora_types ); ... $sth->bind_param($param_num, ' ', { ora_type => ORA_CHAR });

      I'm not an Oracle user at all so I can't guarantee that this is correct.

      Michael