Rick,

Check the usage of single quote (') in your SQL running in perl.
It could be a problem.

Yibin


Rick Windham - ISDLIS wrote:
> 
> I corrected the ")"  problem
> 
> > Hello all,
> >
> > Here is the code snip that I'm using to insert data into Oracle:
> >
> > my $sql = qq{ insert into apache_load_test(host,ident,authuser,http_date) values 
>(?, ?, ?,
> > to_date(?,'dd/mon
> > /yyyy:hh:mi:ss')) };
> > my $sth = $dbh->prepare ( $sql );
> > if (!$dbh)
> > {
> >        print "error connecting; $DBI::errstr\n";
> > }
> > else
> > {
> >     open (EP,"/accounts/rickw/Dec2001access_log");
> >     #open (EP,"/u01/ias/ias10201/Apache/Apache/logs/Dec2001access_log");
> >     while (<EP>)
> >     {
> >         chomp;
> >         s/\[//g;
> >         s/\]//g;
> >         s/"//g;
> >         my @values = split (/ /,$_);
> >         print "ip address $values[0]  $values[1] $values[2] $values[3]\n";
> >         $sth->execute($values[0], $values[1], $values[2], $values[3]) || die 
>("didn't insert
> > $dbh->errstr\n")
> > ;
> >         $dbh->commit;
> >
> > I receive this error:
> >
> 
> didn't insert DBI::db=HASH(0x1d1990)->errstr
> Database handle destroyed without explicit disconnect, <EP> line 1.
> 
> >
> > Sample data from the open file where the data comes from:
> >
> > 191.9.453.334 - - [12/Dec/2001:14:42:08 -0500] "GET 
>/Safety/codeforce/ArtWork/addl_off.gif HTTP/1.1"
> > 304 -
> > 191.9.453.433 - - [12/Dec/2001:14:42:08 -0500] "GET 
>/Safety/codeforce/ArtWork/corr_on.gif HTTP/1.1"
> > 304 -
> > 191.9.453.354 - - [12/Dec/2001:14:42:08 -0500] "GET 
>/Safety/codeforce/ArtWork/corr_off.gif HTTP/1.1"
> > 304 -
> > 191.9.453.234 - - [12/Dec/2001:14:42:08 -0500] "GET 
>/Safety/codeforce/ArtWork/inre_on.gif HTTP/1.1"
> > 304 -
> >
> 
> The 1st 4 fields that come out of this are "191.9.453.334 - - 12/Dec/2001:14:42:08"
> 
> >
> > Any help please..
> >
> > Thanks
> >
> > rickw
> >
> > --
> > ===============================
> > Rick Windham                  |
> > DATABASE ADMINISTRATOR        |
> > MANATEE COUNTY GOVERNMENT ISD |
> > 941-749-3075                  |
> > 941-749-3086 (fax)            |
> > [EMAIL PROTECTED] |
> > ===============================
> 
> --
> ===============================
> Rick Windham                  |
> DATABASE ADMINISTRATOR        |
> MANATEE COUNTY GOVERNMENT ISD |
> 941-749-3075                  |
> 941-749-3086 (fax)            |
> [EMAIL PROTECTED] |
> ===============================

Reply via email to