$sth->execute(undef);


On Thu, 2002-05-30 at 14:01, [EMAIL PROTECTED] wrote:
> 
> Howdy,
> 
> I've got an application that pulls data from an Oracle database to an IBM 
> DB/2 database.  For the IBM database, if the data I'm pulling contains all 
> zeros or all spaces, they want me to insert a NULL into that field.
> 
> When selecting from Oracle I use a decode statement:
> 
>   decode (thisfield, '0000000000', 0);
> 
> When inserting into IBM DB/2 I bind the variable before inserting it:
> 
>   $sth = $dbh->prepare('INSERT INTO FOO (THATFIELD) VALUES (?)");
> 
>   $sth->execute($thisfield);
> 
> Unfortunately, I can't figure out how to tell it to insert a NULL.  The 
> word 'NULL' is interpreted as a character string and he cannot accept 
> zeros.
> 
> How do I tell DBD::DB2 that I want to insert a NULL into a field when 
> using binding params?
> 
> Thanks!
> 
> 
> -- 
> Chris Fuhrman           | Twenty First Century Communications
> [EMAIL PROTECTED] | Software Engineer
> (W) 614-442-1215 x271   |
> (F) 614-442-5662        | PGP/GPG Public Key Available on Request
> 
> 


Reply via email to