Going blind - help me spot my error

Soldato
Joined
1 Mar 2003
Posts
5,508
Location
Cotham, Bristol
I've written the following piece of python code

PHP:
self._cursor.execute("""INSERT INTO PROGRAMME(GENREID,PROGTITLE,SUBTITLE,EPISODE,YEAR,DIRECTOR,PERFORMERS,FILM,WIDESCREEN,
          BNW,STARRATING,CERTIFICATE,DESCRIPTION) VALUES(%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s)""",
          [(genreId,tempDict["PROGTITLE"],tempDict["SUBTITLE"],tempDict["EPISODE"],tempDict["YEAR"],
          tempDict["DIRECTOR"],tempDict["PERFORMERS"],tempDict["FILM"],tempDict["WIDESCREEN"],tempDict["BNW"],
          tempDict["STARRATING"],tempDict["CERTIFICATE"],tempDict["DESCRIPTION"])])

Anyway the error I'm getting is

TypeError: not enough arguments for format string

I've counted the parameters several times, and it looks right to me?
 
Last edited:
Edit: Ignore me, I missed genreId.. :o

I count only 12 variables.
Code:
          1 genreId,tempDict["PROGTITLE"]
          2 tempDict["SUBTITLE"]
          3 tempDict["EPISODE"]
          4 tempDict["YEAR"]
          5 tempDict["DIRECTOR"]
          6 tempDict["PERFORMERS"]
          7 tempDict["FILM"]
          8 tempDict["WIDESCREEN"]
          9 tempDict["BNW"],
          10 tempDict["STARRATING"]
          11 tempDict["CERTIFICATE"]
          12 tempDict["DESCRIPTION"]
 
Back
Top Bottom