RE: :Oracle and bind_param with empty strings

From: Ron Reidy (Ron.Reidy_at_arraybiopharma.com)
Date: 04/20/04


Date: Tue, 20 Apr 2004 11:17:38 -0600
To: "Alexander Bergolth" <leo@strike.wu-wien.ac.at>, <dbi-users@perl.org>

Alexander,

I don't think this is a perl/DBD problem. Is 'NAME_EN' defined as NOT NULL? If so, this will cause the error. What happens if you perform this in SQL*Plus with the same values?

-----------------
Ron Reidy
Senior DBA
Array BioPharma, Inc.

-----Original Message-----
From: Alexander Bergolth [mailto:leo@strike.wu-wien.ac.at]
Sent: Tuesday, April 20, 2004 11:09 AM
To: dbi-users@perl.org
Subject: DBD::Oracle and bind_param with empty strings

Hi!

I'm trying to insert rows containing empty strings into a table using
placeholders and bind_param.

According to my understanding of the DBI documentation, bind_param
should treat undef as null-values but null-values should be substituted
as empty strings.

However, I'm getting errors like below:

DBD::Oracle::st execute failed: ORA-01400: cannot insert NULL into
("BERGOLTH"."ABTEILUNG"."NAME_EN") (DBD ERROR: OCIStmtExecute) [for
statement ``INSERT INTO abteilung (tid, name, name_en, kurzbez, fk_institut)
        VALUES (?, ?, ?, ?, ?)'' with params: :p5='21', :p3='',
:p1='22', :p4='-----', :p2='E xx2 (keine)']) at ./import.pl line 89.

(p3 is '', not undef!)

Any hints?
--leo

P.S.: I'm using Fedora Core 1, Oracle 9.2.0 and
> rpm -q perl perl-DBI perl-DBD-Oracle
perl-5.8.3-16
perl-DBI-1.37-1
perl-DBD-Oracle-1.14-1

-- 
-------------------------------------------------------
Alexander (Leo) Bergolth          leo@leo.wu-wien.ac.at
WU-Wien - Zentrum fuer Informatikdienste - Projektbuero
This electronic message transmission is a PRIVATE communication which contains
information which may be confidential or privileged. The information is intended 
to be for the use of the individual or entity named above. If you are not the 
intended recipient, please be aware that any disclosure, copying, distribution 
or use of the contents of this information is prohibited. Please notify the
sender  of the delivery error by replying to this message, or notify us by
telephone (877-633-2436, ext. 0), and then delete it from your system.


Relevant Pages

  • Res: RE: RE: Problems changing from 1.30 to 1.42
    ... With DBI 1.30 it works just it is: ... >>This electronic message transmission is a PRIVATE communication which contains ... >>intended recipient, please be aware that any disclosure, copying, distribution ... >>sender of the delivery error by replying to this message, or notify us by ...
    (perl.dbi.users)
  • RE: RE: Problems changing from 1.30 to 1.42
    ... >This electronic message transmission is a PRIVATE communication which contains ... >intended recipient, please be aware that any disclosure, copying, distribution ... >sender of the delivery error by replying to this message, or notify us by ...
    (perl.dbi.users)
  • RE: RE: DBI->Connect returning UNDEF in cgi but not in standalone prog
    ... You are returning undef. ... >This electronic message transmission is a PRIVATE communication which contains ... >intended recipient, please be aware that any disclosure, copying, distribution ... >sender of the delivery error by replying to this message, or notify us by ...
    (perl.dbi.users)
  • RE: RE: Problems changing from 1.30 to 1.42
    ... >This electronic message transmission is a PRIVATE communication which contains ... >intended recipient, please be aware that any disclosure, copying, distribution ... >sender of the delivery error by replying to this message, or notify us by ...
    (perl.dbi.users)
  • RE: make problem
    ... Perl may be copied only under the terms of either the Artistic License or the ... This electronic message transmission is a PRIVATE communication which contains information ... If you are not the intended recipient, please be aware that any disclosure, ... Please notify the sender ...
    (perl.dbi.users)