[BangPypers] psycopg2 problem

Anand Chitipothu anandology at gmail.com
Mon Oct 26 12:45:12 CET 2009

> Right .
> Any how I am facing new problem now. See the error. Any hint ?
>   dbcursor.execute( "SELECT id,text FROM %s " ) % indbtname
> psycopg2.ProgrammingError: syntax error at or near "%"
> LINE 1: SELECT id,text FROM %s

You should construct the query first and then pass the query as
argument to execute function.

I suggest you to go through basic python tutorial before trying some
serious programming. Python Tutorial is best place to start.



More information about the BangPypers mailing list