Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: PERL , DBI , DBD and ORACLE
farooq wrote:
>
> Hi,
> We have oracle 8.1.5 running on AIX 4.3.1. I installed PERL 5.6 ,
> DBI 1.20 and DBD-Oracle-1.12. When running a PERL programs, I am
> getting this unusal problem. There is something wrong with this
> combination, as the following message is generated when trying to
> insert :
>
> DBD::Oracle::st execute failed: ORA-01400: cannot insert NULL into
> ("SAC"."T_ANNPROG"."SYS_REC_ACTN_CD") (DBD ERROR: OCIStmtExecute) at
> bad8i3.pl line 37.
> ORA-01400: cannot insert NULL into
> ("SAC"."T_ANNPROG"."SYS_REC_ACTN_CD") (DBD ERROR: OCIStmtExecute) at
> bad8i3.pl line 37.
> $ pwd
>
>
> I am not sure if this is the right group I am posting to, but the PERL
> guys referred to DB groups. Basically , the error shown above is from
> a PERL program that is trying to insert into a database. The thing it
> is complaining about is a blank space " " that it is considering as a
> NULL. I can make the same insert with a blank space from SQL*PLUS, but
> if I put in a blank space in the insert statement (where the field in
> which I am trying to insert into is NOT NULLABLE), then I get this
> error. Somehow, it is not recognizing the blank space ,and mistaking
> it for a NULL, which souldn't be the case. I have tried a different
> combination of PERL ( and its DBI and DBD). The weird thing is , on a
> Oracle7.3.2 Database running on the same machine, with older version
> of PERL ( and DBI,DBD), the same exact program just runs fine.
>
> Any help ? ANYONE ???
>
> Thanks
> Farooq
Farooq,
Are you sure the values you are binding to your $sth are not undef? Are you sure there is not a PRE-INSERT trigger on the table that NULLifies columns whose values are space characters?
-- Ron Reidy Oracle DBA Reidy Consulting, L.L.C.Received on Tue Dec 11 2001 - 14:46:59 CST