Re: AttributeError: 'tuple' object has no attribute 'encode'

2007-04-05 Thread Paul Boddie
erikcw wrote: > > Here is the full error: (sorry) No problem! It's easier to comment with these details... > Traceback (most recent call last): > File "/home/erik/Desktop/wa.py", line 178, in ? > curHandler.walkData() > File "/home/erik/Desktop/wa.py", line 91, in walkData > sql = """INSERT INT

Re: AttributeError: 'tuple' object has no attribute 'encode'

2007-04-05 Thread Paul Boddie
Lenard Lindstrom wrote: > > > > I'm trying to build a SQL string > > > > sql = """INSERT INTO ag ('cid', 'ag', 'test') VALUES(%i, %s, %d)""", > > (cid, ag, self.data[parent][child]['results']['test']) > > I am guessing you want the string formatting operator here: > > sql = """...""" % (cid, ...)

Re: AttributeError: 'tuple' object has no attribute 'encode'

2007-04-05 Thread Lenard Lindstrom
erikcw wrote: > Hi, > > I'm trying to build a SQL string > > sql = """INSERT INTO ag ('cid', 'ag', 'test') VALUES(%i, %s, %d)""", > (cid, ag, self.data[parent][child]['results']['test']) > I am guessing you want the string formatting operator here: sql = """...""" % (cid, ...) The comma creat

Re: AttributeError: 'tuple' object has no attribute 'encode'

2007-04-05 Thread erikcw
On Apr 5, 12:37 pm, "Paul Boddie" <[EMAIL PROTECTED]> wrote: > erikcw wrote: > > > I'm trying to build a SQL string > > > sql = """INSERT INTO ag ('cid', 'ag', 'test') VALUES(%i, %s, %d)""", > > (cid, ag, self.data[parent][child]['results']['test']) > > This makes a tuple, though: the first element

Re: AttributeError: 'tuple' object has no attribute 'encode'

2007-04-05 Thread Paul Boddie
erikcw wrote: > > I'm trying to build a SQL string > > sql = """INSERT INTO ag ('cid', 'ag', 'test') VALUES(%i, %s, %d)""", > (cid, ag, self.data[parent][child]['results']['test']) This makes a tuple, though: the first element is the SQL string; the second element contains a tuple of parameters.

Re: AttributeError: 'tuple' object has no attribute 'encode'

2007-04-05 Thread erikcw
On Apr 5, 11:41 am, [EMAIL PROTECTED] wrote: > On Apr 5, 10:31 am, "erikcw" <[EMAIL PROTECTED]> wrote: > > > Hi, > > > I'm trying to build a SQL string > > > sql = """INSERT INTO ag ('cid', 'ag', 'test') VALUES(%i, %s, %d)""", > > (cid, ag, self.data[parent][child]['results']['test']) > > > It rais

Re: AttributeError: 'tuple' object has no attribute 'encode'

2007-04-05 Thread kyosohma
On Apr 5, 10:31 am, "erikcw" <[EMAIL PROTECTED]> wrote: > Hi, > > I'm trying to build a SQL string > > sql = """INSERT INTO ag ('cid', 'ag', 'test') VALUES(%i, %s, %d)""", > (cid, ag, self.data[parent][child]['results']['test']) > > It raises this error: AttributeError: 'tuple' object has no attrib