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";
--
it fails, it tried quoting it with:
$qstr = q!to_char(sysdate, 'Dy DD-Mon-YYYY HH24:MI')!;
and plugging that in:
$dbh->prepare( "INSERT INTO stats VALUES ($qstr,?,?,?,?)" 
--
failed !

even tried quote():
$qstr = "to_char(sysdate, 'Dy DD-Mon-YYYY HH24:MI')";
$q = $dbh->quote($q);
$dbh->prepare( "INSERT INTO stats VALUES ($q,?,?,?,?)" 
--
still fails

any ideas?

Thanks
Jim

Reply via email to