For some reason I cannot use placeholders in an ALTER SESSION statement. This works:
sub set_date_format
{
my($dbh, $format) = @_;
my $sql = <<"EOF";
ALTER SESSION SET NLS_DATE_FORMAT = '$format'
EOF
my $sth = $dbh->prepare($sql);
$sth->execute;
}
But this does not:
sub set_date_format
{
my($dbh, $format) = @_;
my $sql = <<"EOF";
ALTER SESSION SET NLS_DATE_FORMAT = ?
EOF
my $sth = $dbh->prepare($sql);
$sth->execute($format);
}
Very odd (Score:2)