-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

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');

`undef` is the proper way to insert NULL.  The above is inserting the literal 
string 'NULL'.

Try the following:

$sth->execute('HIGH','10.1.9.124',undef,undef);

- -- 
Stephen Clouse <[EMAIL PROTECTED]>
Senior Programmer, IQ Coordinator Project Lead
The IQ Group, Inc. <http://www.theiqgroup.com/>

-----BEGIN PGP SIGNATURE-----
Version: PGP 6.5.8

iQA/AwUBO3mL1AOGqGs0PadnEQJqAgCfYFoT3H6kXj9WvBtRe0AxhEbHlV8An3Zq
GG+wp+AsD+stYJygX4mub3pT
=pcsr
-----END PGP SIGNATURE-----

Reply via email to