Greetings all,
I'm trying the following INSERT statement with DBI 1.21:
use DBI;
use strict;
DBI->trace(2,'test.log');
$dbh->do(qq{
INSERT INTO TEST
VALUES (TEST_SEQ.NEXTVAL,
SUBSTR(?,0,100),
DECODE(?,'N/A',''),
SUBSTR(?,0,2000)
)
} , undef,
$name,$score,$comment);
Where $score can be 1..5 or the string "N/A" (default). As I understand
it, if the score defaults to N/A, shouldn't the decode function NULLIFY
it?
Looking through the Oracle log output, even when the user
inputs $score to a number, it is being decoded to NULL.
Is this an SQL error or a bug in DBI?
Many thanks,
Stacy.