I try to insert null values into date fields in Oracle from perl, but instead of null values it ends up inserting sysdate. When I do the same from sqlplus, it inserts the null values.
My code (just the important part)
use DBI;
use DBD::Oracle qw(ORA_RSET);
...
eval {
$sth = $dbh->prepare(q{
INSERT INTO MY_TABLE
(VAL1, VAL2, VAL3, ENTRY_DATE, PROCESSED_DATE)
VALUES (?,?,?,?,?)});
my $rv = $sth->execute($VAL1, $VAL2, $VAL3, undef, undef);
$insert_counter++;
};
if ( $@ ) {
$FILE_PROCESS_STATUS = FILE_INVALID;
logg("e", "$@");
}
if ( $FILE_PROCESS_STATUS = FILE_VALID ) {
$dbh->commit;
}