I'm using "$DBD::Oracle::VERSION = '1.15' with ActiveState Perl v5.8.0 build 802.
With the code listed below, I am doing inserts to a database.
# Build my insert statement...
my $insert_start = "insert into $tablemap (";
my $insert_end = ") values (";
my $colcount = 1;
foreach (@cols) {
$insert_start .= $_;
$insert_end .= "?";
if ($colcount < scalar(@cols)) { $insert_start .= ", "; $insert_end .= ", ";}
$colcount++;
}
$insert_end .= ");";
my $insert_statement = $insert_start . $insert_end;
print "$insert_statement\n";
# Prepare the insert statement, and start inserting the data...
my $DataInsert = $dbh->prepare(Format_SQL($insert_statement));
while (my (@rets) = $Text_sth->fetchrow_array) {
my @valuelist;
$colcount = 0;
foreach my $col (@cols) {
my $ret = $rets[$colcount];
if ($ret eq "") { $valuelist[$colcount] = qw /NULL/; }
else { $valuelist[$colcount] = $ret; }
$colcount++;
}
unless ($DataInsert->execute(@valuelist) ) {
print LOGFILE "errors: $dbh->errstr \n";
print LOGFILE "\nErrors were encountered during data load...\n";
}
}
$DataInsert->finish;
This all works fine with MSSQL (using DBD::ODBC), and with Sybase (using
DBD::Sybase). However, with Oracle it dies on the first insert...
insert into ALERT (Alert_ID, Name, ItemID, SGML_ID, CDM_Type) values (?, ?, ?, ?, ?);
DBD::Oracle::st execute failed: ORA-00911: invalid character (DBD ERROR: error
possibly near <*> indicator at char 94 in 'insert into Table (ID_Col, Name, ItemID,
Alt_ID, C_Type) values (:p1, :p2, :p3, :p4, :p5)<*>;') [for Statement "insert into
Table (ID_Col, Name, ItemID, Alt_ID, C_Type) values (?, ?, ?, ?, ?);" with
ParamValues: :p5='W', :p3='NULL', :p1='600', :p4='Y48840', :p2='Notice Notice'] at
D:\development\dbd_db.pl line 248.
Hints, tips and suggestions welcome...
Thank you,
amonotod
--
`\|||/ amonotod@ | subject line:
(@@) charter.net | no perl, no read...
ooO_(_)_Ooo________________________________
_____|_____|_____|_____|_____|_____|_____|_____|