MySQLdb question

John Hunter jdhunter at nitace.bsd.uchicago.edu
Thu Jun 20 09:34:49 EDT 2002


>>>>> "Micha³" == Micha³ Kurowski <mkur at poczta.gazeta.pl> 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))

JDH



More information about the Python-list mailing list