Re: Apostrophe and UPDATE

2013-10-09 Thread Paul Foraker
On Wed, Oct 9, 2013 at 7:02 AM, Dr. Hawkins wrote: > You're using the wrong escape. > > Inside a string, you need a double single quote, not a backslash. > > It's worth keeping a preSql() function around, like: > > function preSQL pSQL > replace "'" with "''" in pSQL >if pSQL is empty the

Re: Apostrophe and UPDATE

2013-10-09 Thread Paul Foraker
On Wed, Oct 9, 2013 at 1:32 AM, stephen barncard < stephenrevoluti...@barncard.com> wrote: > > Stephen, escaping the single quote with another quote causes the same > > error, with the result showing \'\' instead of \'. I tried it with and > > without variable substitution. > > > > thanks, Paul.

Re: Apostrophe and UPDATE

2013-10-09 Thread Peter Haworth
Don't need to escape anything when using the :1,:2,etc notation, but if you did, it would be ''' not \'. The update syntax is UPDATE tablename SET colname=:1 etc Pete lcSQL Software On Oct 9, 2013 3:55 AM, "Paul Foraker" wrote: > Stephen, escaping the single quote with another quote causes the

Re: Apostrophe and UPDATE

2013-10-09 Thread Dr. Hawkins
On Tue, Oct 8, 2013 at 11:37 PM, Paul Foraker wrote: > '(last_name,notes) VALUES ("O\'Byrne", "betting this won\'t work!") WHERE > id=599' at line 1 > You're using the wrong escape. Inside a string, you need a double single quote, not a backslash. It's worth keeping a preSql() function around,

Re: Apostrophe and UPDATE

2013-10-09 Thread stephen barncard
On Wed, Oct 9, 2013 at 12:55 AM, Paul Foraker wrote: > Stephen, escaping the single quote with another quote causes the same > error, with the result showing \'\' instead of \'. I tried it with and > without variable substitution. > thanks, Paul. This goes in my Script Scrapbook. -- Steph

Re: Apostrophe and UPDATE

2013-10-09 Thread Paul Foraker
Stephen, escaping the single quote with another quote causes the same error, with the result showing \'\' instead of \'. I tried it with and without variable substitution. Monte, my UPDATE syntax was incorrect. Thanks! In case anyone else needs something like this, here's the code that worked:

Re: Apostrophe and UPDATE

2013-10-08 Thread Monte Goulding
On 09/10/2013, at 5:37 PM, Paul Foraker wrote: > Any suggestions? Check your UPDATE syntax: http://www.w3schools.com/sql/sql_update.asp Cheers Monte -- M E R Goulding Software development services Bespoke application development for vertical markets mergExt - There's an external for that!

Re: Apostrophe and UPDATE

2013-10-08 Thread stephen barncard
http://stackoverflow.com/questions/9596652/how-to-escape-apostrophe-in-mysql On Tue, Oct 8, 2013 at 11:37 PM, Paul Foraker wrote: > While building a LiveCode front end to a MySQL database, I ran into the > apostrophe-in-the-data problem. My friend "O'Byrne" cannot get updated. > > For INSERTs,