Hi,

Using DBI 1.30 on FreeBSD 4.6 with mySQL 4.04, DBD::mysql 2.0416, and Perl 5.06

Is it possible to insert a NULL with query like this?

$insert = qq!

INSERT INTO blah a,b,c VALUES (?,?,?)

!;

$insert_hnd = $dbh->prepare($insert_orders);

$insert_hnd->execute($var1,$var2,$var3);



Ok, so I have three vars to place in my execute statement, how can I make one of them at least potentially insert a NULL?


Or is there no way to do this with this form?
I am trying to keep some logic out of a query module, but I can't get this to work. Most of the time $var3 will have data. Some of the time it needs to be left NULL. Setting $var3 = 'NULL' or '"" doesn't work. What if I undef ed $var3?



Thanks,


Eric

Reply via email to