MySQLdb question

John Hunter jdhunter at
Thu Jun 20 09:34:49 EDT 2002

>>>>> "Micha³" == Micha³ Kurowski <mkur at> writes:

    Micha³> I cannot find a way to pass a sql statement a table as a
    Micha³> parameter.

Use the %s thingie:

c.execute('SELECT spam, eggs, sausage FROM %s
           WHERE price < %s', (table_name, max_price))


More information about the Python-list mailing list