Cine has asked for the wisdom of the Perl Monks concerning the following question:
Which gives the excellent message:my $odbh = DBI->connect("dbi:Oracle:stuff","xxx","x", { RaiseError => +1, PrintError => 1, ChopBlanks => 0 }); my $mdbh = DBI->connect("dbi:mysql:kultur","xxx","x", { RaiseError => +1, PrintError => 1 }); $odbh->{ChopBlanks} = 0; my $msth = $mdbh->prepare("SELECT * FROM atable limit 1"); my $osth = $odbh->prepare("INSERT INTO atable (".(join",",@atablelist) +.") VALUES (".(join ",",map {"?"} @atablelist).")"); $msth->execute() || die $mdbh->errstr; while (my $db=$msth->fetchrow_hashref) { $osth->execute(map {defined $$db{$_} && $$db{$_} eq '' ? " " : $$db{ +$_}} @atablelist) || die $odbh->errstr; }
DBD::Oracle::st execute failed: ORA-01400: cannot insert NULL into ("X +XX"."ATABLE"."ARROVERSKRIFTSPROG") (DBD ERROR: OCIStmtExecute)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Oracle DBI quote
by mpeppler (Vicar) on Oct 25, 2002 at 21:06 UTC | |
by Cine (Friar) on Oct 25, 2002 at 22:53 UTC | |
by mpeppler (Vicar) on Oct 25, 2002 at 23:27 UTC | |
|
Re: Oracle DBI quote
by demerphq (Chancellor) on Oct 25, 2002 at 19:22 UTC | |
|
Re: Oracle DBI quote
by runrig (Abbot) on Oct 25, 2002 at 19:50 UTC | |
by Cine (Friar) on Oct 25, 2002 at 22:58 UTC |