Re: baffling sql string

2006-09-27 Thread DarkBlue
Duncan Booth wrote: > ... > > depending on your actual database you might need to use something other > than %s to specify the parameters. Check out 'paramstyle' for your > database connection. Thank you all for prompt suggestions I am using firebird 1.5.3 with kinterbasdb Db -- http://mail.p

Re: baffling sql string

2006-09-27 Thread John Machin
DarkBlue wrote: > Following is a code snippet from a pythoncard app > the problem is with the sql string called iq1 > If either mysubject or mytalktext contains an > apostrophe the update fails : > Example: mysubject="Let's Eat" this fails > mysubject="Lets Eat" this works fine > > What

Re: baffling sql string

2006-09-27 Thread Paul Boddie
DarkBlue wrote: > > Example: mysubject="Let's Eat" this fails > mysubject="Lets Eat" this works fine > > What options do I have to avoid this issue but still > can use apostrophes in my input data ? Use proper "bind parameters" or "bind variables" when executing the statement, rather t

Re: baffling sql string

2006-09-27 Thread skip
DarkBlue> Following is a code snippet from a pythoncard app DarkBlue> the problem is with the sql string called iq1 DarkBlue> If either mysubject or mytalktext contains an DarkBlue> apostrophe the update fails : DarkBlue> Example: mysubject="Let's Eat" this fails DarkBlue

Re: baffling sql string

2006-09-27 Thread Duncan Booth
DarkBlue <[EMAIL PROTECTED]> wrote: > iq1="update MSGTALK set msgdate='NOW',subject='%s',talktext='%s' where > msgno= %d " % (mysubject,mytalktext,mymsgno) > try: >self.cur.execute(iq1) Use parameterised queries and get rid of the quotes in the SQL: iq1="update MSGTALK set msgdate='NOW',sub

baffling sql string

2006-09-27 Thread DarkBlue
Following is a code snippet from a pythoncard app the problem is with the sql string called iq1 If either mysubject or mytalktext contains an apostrophe the update fails : Example: mysubject="Let's Eat" this fails mysubject="Lets Eat" this works fine What options do I have to avoid th