Trying to follow the SQLA tutorial at 
http://mapfish.org/doc/tutorials/sqlalchemy.html
but find that I get stuck at the first hurdle (the Engine API bit) due
to a string formatting problem:

sqlalchemy.exc.ProgrammingError: (ProgrammingError) syntax error at or
near ","
LINE 1: INSERT INTO users(username, password) VALUES ( ?, ? )
 
^
 'INSERT INTO users(username, password) VALUES ( ?, ? )' (u'bob',
u'bobpwd')


Getting rid of the question marks and doing string interpolation in
the typical way works just fine:

connection.execute("INSERT INTO users(username, password) VALUES
( '%s', '%s' )'" % (u'bob', u'bobpwd'))

but I'd rather make use of SQLAs interpolation mechanism so as to
guard against SQL injection.

Any ideas as to where I could be going wrong?

SQLA 0.6.3
Python 2.5
Connection to a UTF8-encoded Postgres 8.4.4 database.

Cheers,

Will

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalch...@googlegroups.com.
To unsubscribe from this group, send email to 
sqlalchemy+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en.

Reply via email to