Varibles in SQL statements

Rob Elder relder at omegabit.com
Fri May 19 13:38:26 EDT 2000


Hello,

   I don't understand how to use (or format really) varibles in SQL.With
the sequence

var = '1'
mycursor.execute('SELECT userID FROM userTable WHERE userID=var')

I get a too few paramerters error 

This does work:

mycursor.execute("SELECT userID FROM userTable WHERE userID='1'") 

???

TIA.

-r



More information about the Python-list mailing list