in reply to Inserting an empty string, not NULL, with $dbh->quote()

I strictly use $dbh->quote() to quote data before inserting or selecting it with MySQL using DBI.

Get rid of that. Use placeholders. Really. Perl and DBI ain't PHP.

Alexander

--
Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)
  • Comment on Re: Inserting an empty string, not NULL, with $dbh->quote()

Replies are listed 'Best First'.
Re^2: Inserting an empty string, not NULL, with $dbh->quote()
by afoken (Chancellor) on Jan 05, 2012 at 15:38 UTC
      Oracle also has the nasty habit of treating NULL and empty strings equally or converting one to the other -- not always, but always when you don't expect it.
      With VARCHAR2 there is no "treating equally or converting".

      An empty VARCHAR2-string IS a NULL - always.