DBD::Oracle and bind_param with empty strings

From: Alexander Bergolth (leo_at_strike.wu-wien.ac.at)
Date: 04/20/04


Date: Tue, 20 Apr 2004 19:08:59 +0200
To: dbi-users@perl.org

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


Relevant Pages

  • LongReadLen = 0 definition
    ... The DBI documentation for LongReadLen includes: ... "A value of 0 means not to automatically fetch any long data. ... return "undef" for long fields when "LongReadLen" is 0.)" ... Martin J. Evans ...
    (perl.dbi.users)
  • Re: AppConfig loading undef values into ARGCOUNT_LIST
    ... k> What is the syntax for loading empty or empty strings into an ... k> AppConfig value set to ARGCOUNT_LIST? ... k> I would like AppConfig to add an undef or empty string to the list ... would set VAR to undef. ...
    (comp.lang.perl.modules)
  • AppConfig loading undef values into ARGCOUNT_LIST
    ... What is the syntax for loading empty or empty strings into an ... AppConfig value set to ARGCOUNT_LIST? ... Thing = <undef> ...
    (comp.lang.perl.modules)