List:General Discussion« Previous MessageNext Message »
From:Paul DuBois Date:January 7 2003 9:45pm
Subject:Re: Using Perl DBI quote() method with NULL values?
View as plain text  
At 18:32 +0000 1/7/03, Jeff Snoxell wrote:
>Hello,
>
>I've got a mysql table with a lot of fields and I'm using a map 
>statement to pass each of my values for a new record through the 
>quote system so-as to have everything nicely wrapped up. Problem is 
>that I can't find any way of writing a null value to my DB when the 
>value has first passed through quote().
>
>I've tried:
>
>my $err = $MyDatabase->do('INSERT INTO MyTable VALUES(' .
>   join(",",map($MyDatabase->quote($_),
>   0, # REF
>   0, # PARENT REF
>   $FormData{'Title'} . " " . $FormData{'Name'} . "",
>   $FormData{'Email'} . "",
>   "\N",  # <-- I REALLY WANT THIS TO BE A NULL VALUE!

Use undef to get a NULL value.

>   etc.,
>   etc.,
>   etc.....
>        )) .
>      ')');
>
>Which works fine except the "\N" isn't entered into my database as a 
>null value. I've also tried '\N' and '' and "".
>
>Any ideas how I can solve this easily?
>
>Thanks,
>
>Jeff


Thread
Executing the "source c:/Test.sql" commandAmit Lonkar18 Dec
  • Re: Executing the "source c:/Test.sql" commandPaul DuBois18 Dec
    • Accessing last_insert_id problem.Jeff Snoxell18 Dec
      • re: Accessing last_insert_id problem.Victoria Reznichenko18 Dec
        • re: Accessing last_insert_id problem.Jeff Snoxell18 Dec
          • re: Accessing last_insert_id problem.Wico de Leeuw18 Dec
          • Re: Accessing last_insert_id problem.Michael T. Babcock18 Dec
          • re: Accessing last_insert_id problem.Paul DuBois18 Dec
            • re: Accessing last_insert_id problem.Jeff Snoxell19 Dec
              • re: Accessing last_insert_id problem.Wico de Leeuw19 Dec
            • thread_cache . what is it ? (no newbie question) .cristian ditoiu20 Dec
              • Re: thread_cache . what is it ? (no newbie question) .Benjamin Pflugmann20 Dec
      • Re: Accessing last_insert_id problem.Paul DuBois18 Dec
      • Re: Accessing last_insert_id problem.Matthew Smith2 Jan
        • Using Perl DBI quote() method with NULL values?Jeff Snoxell7 Jan
          • Re: Using Perl DBI quote() method with NULL values?Paul DuBois7 Jan
          • Re: Using Perl DBI quote() method with NULL values?Keith C. Ivey8 Jan
      • Re: Using Perl DBI quote() method with NULL values?walt7 Jan
      • Re: Using Perl DBI quote() method with NULL values?Rodney Broom8 Jan
      • Re: Using Perl DBI quote() method with NULL values?Salam Baker Shanawa8 Jan
  • Re: Accessing last_insert_id problem.Harald Fuchs18 Dec
Re: Accessing last_insert_id problem.Jeff Snoxell19 Dec
  • Re: Accessing last_insert_id problem.Paul DuBois19 Dec
  • RE: Accessing last_insert_id problem.Will Merrell20 Dec
    • Badly placed ()'s and also access deniedGary Hostetler20 Dec
      • RE: Badly placed ()'s and also access deniedJennifer Goodie20 Dec
        • Re: Badly placed ()'s and also access deniedGary Hostetler20 Dec