On 14 Mar 2008, at 19:36, Mark Trostler wrote:

the quote() function is quite lame in my experience - for raw SQL I use:

   # get rid of any backshlased single quotes
   $value =~ s/\\'/'/g;

   # Fixup regular single quotes
   $value =~ s/'/', char(39), '/g;

   # Get rid of question marks
   $value =~ s/\?/', char(63), '/g;

So "What's up" ends up like: 'What', char(39), 's up'

        Mark



Not condoning quoting stuff yourself at all, but why not 'What''s up' ?

mysql> select 'What''s up' \G
*************************** 1. row ***************************
What's up: What's up
1 row in set (0.00 sec)


I'm fairly positive this is what the SQL standard says you should do too.

-ash

_______________________________________________
List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
Searchable Archive: http://www.grokbase.com/group/[EMAIL PROTECTED]

Reply via email to