Re: [DB-SIG] mysql string length?

2006-04-18 Thread Andy Dustman
On 4/17/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > On Mon, 17 Apr 2006, Andy Todd wrote: > > >> stmt = "INSERT INTO table_x (body) VALUES (%s)" # [1] > >> cursor.execute(stmt, (body,)) > >>> [1] note that there are no quote marks around the %s > >> > >> this works here (debian testi

Re: [DB-SIG] mysql string length?

2006-04-18 Thread Lukasz Szybalski
On 4/17/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > On Mon, 17 Apr 2006, Andy Todd wrote: > > >> stmt = "INSERT INTO table_x (body) VALUES (%s)" # [1] > >> cursor.execute(stmt, (body,)) > >>> [1] note that there are no quote marks around the %s > >> > >> this works here (debian testi

Re: [DB-SIG] mysql string length?

2006-04-18 Thread Lukasz Szybalski
On 4/18/06, Lukasz Szybalski <[EMAIL PROTECTED]> wrote: > On 4/17/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > On Mon, 17 Apr 2006, Andy Todd wrote: > > > > >> stmt = "INSERT INTO table_x (body) VALUES (%s)" # [1] > > >> cursor.execute(stmt, (body,)) > > >>> [1] note that there are

Re: [DB-SIG] mysql string length?

2006-04-18 Thread engelbert . gruber
On Tue, 18 Apr 2006, Lukasz Szybalski wrote: SNIP > Ok guys, thanks for help. I finally search for how to scape strings and i > used: > > "insert into table(id,body) values ('%d',"'''"%s"'''")"%(id,body) > > where "'''" on each side of s = double quote + 3x single quote+ double quote as andy d

Re: [DB-SIG] mysql string length?

2006-04-18 Thread Python
On Tue, 2006-04-18 at 13:00 -0500, Lukasz Szybalski wrote: > > When i try : > > c.execute("Insert into table_x(body) VALUES(%s)",(body)) > > This will work but how do i make : > > > > sql="Insert into table_x(body) VALUES(%s)",(body) > > c.execute(sql) #complains that i give it a tuple, which i di