[DB-SIG] Mysqldb python variable in request

samira M'Bata bouataa at hotmail.com
Thu Jan 22 04:38:20 EST 2004

i hope someone could help me.
I d like to make an sql statement with python, in which the column names 
will be parameter of a python function.
Bevore I tried to define my definition, i tried this code:

target= 'DataType'
constraint= 'Location'
#DataType and Location are two columns of my Table
constraint_value= 'stuttgart'
cursor.execute(""" select %s from Xml2Mysql where %s=%s """,(target, 
constraint, constraint_value))

I think the problem comes from the fact that my columns names are not as a 
string type defined.

Should I change something in my table definition?

Add photos to your messages with MSN 8. Get 2 months FREE*. 

More information about the DB-SIG mailing list