> From: Dan Hopkins <[EMAIL PROTECTED]>
> Date: 2004/09/21 Tue AM 09:45:32 GMT
> 
> > -----Original Message-----
> > From: amonotod [mailto:[EMAIL PROTECTED]
> > Sent: 20 September 2004 17:09
> >
> >   1) if you're using place-holders, assign undef() to the value, and 
> > the DBI *should* convert it to NULL.
> > 
> >    if ( 
> >        ($myVal) #Is it defined?
> >        & 
> >        (($myVal eq '') or ($myVal eq ' ') ) #But blank?
> >        )
> >        { $myVal = "NULL"; }
> [snip]
> 
> Avoid doing this, it's bad practice and won't do what you expect. Check for
> defined variables using defined() - (in your code above, $myVal will return
> false if defined but having an empty or 0 value...)
> 
> if (defined($myVal) 
>       && ($myVal eq '' || $myVal eq ' '))
> 

Good point...  Also, I made another error (Yesterday was a BAD-BAD Monday)...
 
The last line of that is:
  { $myVal = "NULL"; }

and it should be:
  { $myVal = undef(); }


> Dan

amonotod


--

    `\|||/         amonotod@    | sun|perl|windows
      (@@)         charter.net  | sysadmin|dba
  ooO_(_)_Ooo____________________________________
  _____|_____|_____|_____|_____|_____|_____|_____|

Reply via email to