On Tue, Aug 14, 2001 at 02:32:04PM -0600, HUA, Qing wrote:
> 
> I am trying to insert using the following statements. Somehow,
> VARCHAR NULL can be inserted, but the NUMBER NULL keeps giving me
> ORA-01722: invalid number (DBD ERROR: OCIStmtExecute).
> 
> What did I do wrong? Thanks!
> 
> $insert = "INSERT INTO test_database (TEST_PRIOR, TESTER_IP_ADDR,
> TEST_DURATION, TEST_RESULT)
> VALUES
> (?,?,?,?)";
> $sth=$dbh->prepare($insert);
> $sth->execute('HIGH', '10.1.9.124',NULL,'NULL');

NULL in SQL is undef in Perl, so you should bind undef to those
placeholders, instead of the string 'NULL'.

Ronald

Reply via email to