use strict; use DBI; $ENV{'ORACLE_HOME'} = '/pkg/oracle/client10g'; my $sid = 'mysid'; my $user = 'joe'; my $pass = 'joespw'; my $dbh = DBI->connect( "dbi:Oracle:$sid", "$user", "$pass" ) || die( $DBI::errstr . "\n" ); $dbh->{AutoCommit} = 0; $dbh->{RaiseError} = 1; $dbh->{ora_check_sql} = 0; $dbh->{RowCacheSize} = 16; my $sql = qq{insert into reservation (machinename,reservationida,beginreserve,endreserve,description,reservationid) values (?,?,TO_TIMESTAMP(?,'DD/MON/YYYY HH:MI:SS'), TO_TIMESTAMP(?,'DD/MON/YYYY HH.MI.SS'),?,?)}; my $sth = $dbh->prepare($sql); $sth->bind_param(1, 'volcano'); $sth->bind_param(2, 666); $sth->bind_param(3, '12/MAR/2010 7:20:00'); $sth->bind_param(4, '12/MAR/2010 8:20:00'); $sth->bind_param(5, 'This machine tends to explode!'); $sth->bind_param(6, 666); #print "$sql\n"; $sth->execute; $sth->finish; $dbh->disconnect;