Loading ...
Sorry, an error occurred while loading the content.

RE: [PBML] DBI return

Expand Messages
  • Stamper, Steve
    THAT S IT! Works great. Your my hero for the day!!!! Thanks so much! ... From: Jenda Krynicky [mailto:Jenda@Krynicky.cz] Sent: Friday, October 15, 2004 8:37
    Message 1 of 3 , Oct 15, 2004
    • 0 Attachment
      THAT'S IT! Works great. Your my hero for the day!!!!

      Thanks so much!



      -----Original Message-----
      From: Jenda Krynicky [mailto:Jenda@...]
      Sent: Friday, October 15, 2004 8:37 AM
      To: perl-beginner@yahoogroups.com
      Subject: Re: [PBML] DBI return



      From: "Stamper, Steve" <sstamper@...>
      > I have written a DBI() query against MYSQL and it works just fine. My
      > line in question is:
      > $ITMDESCNOTE = $H->{'ITMDescNote'};
      >
      > My question is, when the MYSQL ITMDescNote field is empty (NULL?) the
      > $ITMDESCNOTE variable is not set. How can I either set $ITMDESCNOTE
      > to "" or check if the variable exists?

      NULLs in database are translated as undefs in Perl so you may use the
      defined() builtin function to check this:

      $ITMDESCNOTE = defined($H->{'ITMDescNote'}) ? $H->{'ITMDescNote'} :
      "";

      Jenda
      ===== Jenda@... === http://Jenda.Krynicky.cz =====
      When it comes to wine, women and song, wizards are allowed
      to get drunk and croon as much as they like.
      -- Terry Pratchett in Sourcery




      Unsubscribing info is here:
      http://help.yahoo.com/help/us/groups/groups-32.html
      Yahoo! Groups Links








      [Non-text portions of this message have been removed]
    Your message has been successfully submitted and would be delivered to recipients shortly.