Correcting myself:

> > -----Original Message-----
> > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
> > Sent: Friday, 27 August 2004 8:51 a.m.
> > To: Robert
> > Cc: [EMAIL PROTECTED]
> > Subject: Re: DBI insert records
> > 
> > You could either set the NLS date format, or wrap a to_date around you 
> > placeholder, something like (untested)
> > 
> > to_date(?, 'DD/Mon/YYYY:24HH:MI:SS') for 16/Aug/2004:15:06:54
> 
>   '24HH' isn't valid.  'HH24' should be used in it's place.

 ... used in its place.

  [...]
>   Although to me, that looks messy.  Personally, I'd write it 
> like this:
> 
> $sql = q{
>   INSERT INTO webtest (hostname, datetime, url, username, company)
>   VALUES ( NULL, TO_DATE(?,'DD/Mon/YYYY:HH24:MI:SS'), ?, ?, ? )
> };
> $dbh2->do($sql, $hostname, $datetime, $url, $username, $company )
>   or <<insert-error-handler-here>>;

$sql = q{
  INSERT INTO webtest (hostname, datetime, url, username, company)
  VALUES ( ?, TO_DATE(?,'DD/Mon/YYYY:HH24:MI:SS'), ?, ?, ? )
};
$dbh2->do($sql, $hostname, $datetime, $url, $username, $company )
  or <<insert-error-handler-here>>;


Reply via email to