Folks,
I'm receiving the following error from this code:
#!/usr/bin/perl -w
use DBI;
my ($dbh, $sth, $network_status, $sysdate, $seq);
#perform the database connection
$dbh = DBI->connect("dbi:Oracle:ORACLE","larry", "wall", {
PrintError => 0,
RaiseError => 1
});
unlink 'dbitrace.log' if -e 'dbitrace.log';
DBI->trace(2, 'dbitrace.log');
#prepare a sql statement for execution
$network_status = "down";
$sysdate = "sysdate";
$seq = "dhcp_status_seq.nextval";
$sth = $dbh->prepare("insert into dhcp_status values
(?, ?, ?"
;
$sth->bind_param( 1, $network_status );
$sth->bind_param( 2, $sysdate);
$sth->bind_param( 3, $seq);
#execute the statement in the oracle database
$sth->execute();
#disconnect from the database
$dbh->disconnect();
exit;
DBD::Oracle::st execute failed: ORA-00917: missing comma (DBD ERROR: OCIStmtExecute) at ./dbinsert2.pl line 30.
Line 30 is the execute statement, can't figure out where the problem is. Newbie to perl and DBI, please help.
Thanks,
StickyBit.
I'm receiving the following error from this code:
#!/usr/bin/perl -w
use DBI;
my ($dbh, $sth, $network_status, $sysdate, $seq);
#perform the database connection
$dbh = DBI->connect("dbi:Oracle:ORACLE","larry", "wall", {
PrintError => 0,
RaiseError => 1
});
unlink 'dbitrace.log' if -e 'dbitrace.log';
DBI->trace(2, 'dbitrace.log');
#prepare a sql statement for execution
$network_status = "down";
$sysdate = "sysdate";
$seq = "dhcp_status_seq.nextval";
$sth = $dbh->prepare("insert into dhcp_status values
(?, ?, ?"
$sth->bind_param( 1, $network_status );
$sth->bind_param( 2, $sysdate);
$sth->bind_param( 3, $seq);
#execute the statement in the oracle database
$sth->execute();
#disconnect from the database
$dbh->disconnect();
exit;
DBD::Oracle::st execute failed: ORA-00917: missing comma (DBD ERROR: OCIStmtExecute) at ./dbinsert2.pl line 30.
Line 30 is the execute statement, can't figure out where the problem is. Newbie to perl and DBI, please help.
Thanks,
StickyBit.