On Tue, Jun 25, 2002 at 12:41:05PM -0400, Kipp, James wrote: > This works fine: > my $sth = $dbh->prepare( "INSERT INTO stats VALUES (SYSDATE,?,?,?,?)" ) > or die "Cannot prepare SQL statements from $DBI::errstr\n"; > > however if i try to format it like: > my $sth = $dbh->prepare( "INSERT INTO stats VALUES (to_char(SYSDATE, 'Dy > DD-Mon-YYYY HH24:MI'),?,?,?,?)" ) > or die "Cannot prepare SQL statements from $DBI::errstr\n"; > --
What is the data type for the field into which you are inserting the date? If it's a DATE field, you do the formatting when you retrieve the value, not when you set it. If it's not a DATE field, it should be. Ronald
