Are you using a high level library such as Perl::DBI? If so, you should run all your strings the quote method. That will quote it properly for each database you connect to. If you are connecting to all the databases yourself using custom code, I would recommend you find some database neutral libraries and go from there.
j----- k----- On Thursday 08 April 2004 01:37 pm, Christos Karras said something like: > Is there a way to disable the use of the backslash as an escape > character in strings? I need to use an application that's designed to > work on any database server supporting ANSI SQL. When it generates SQL > insert/update queries, it doesn't escape backslashes in strings, because > the ANSI SQL standard doesn't require backslashes to be escaped. > > So to insert the value "\", the application generates the following query: > INSERT INTO (test) VALUES('\'); > Which causes an error in MySQL because it thinks the \ is an escape > character and the string is not closed. > > If I modify the application to escape backslashes by replacing \ by \\, > it works with MySQL, but with other databases that don't interpret the > backslash as an escape character, it inserts two backslashes instead of > one. > > What could I do to tell MySQL it should interpret strings in the > standard way? > I tried starting mysqld in ANSI mode (mysqld-max-nt --ansi) but it > doesn't solve the problem. > > I would also prefer a per-connection way to fix this, is there an option > I can set when connecting that won't affect other connections? I also > have other applications using the same MySQL server, some of which are > designed specifically for MySQL, so they may escape backslashes in the > MySQL way and switching the whole server to ANSI mode would break them. > > I'm using MySQL 3.23 but I'm willing to upgrade to the latest 4.0x if it > can solve this problem. -- Joshua J. Kugler Fairbanks, Alaska Computer Consultant--Systems Designer .--- --- ... .... ..- .- -.- ..- --. .-.. . .-. [EMAIL PROTECTED] ICQ#:13706295 Every knee shall bow, and every tongue confess, in heaven, on earth, and under the earth, that Jesus Christ is LORD -- Count on it! -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]