correct syntax for db api..

eugene kim eugene1977 at hotmail.com
Sat Jul 20 16:35:52 EDT 2002


i'm trying to find correct syntax for this sql statement..


import pgdb

db=pgdb.connect(user='postgres',database='test')
cursor=db.cursor()

-----------------
cursor.execute('select url, visits from history where url= %s', (self.url))     
-------------
or
-----------------
sqlselect = 'select url, visits from history where url = %s '
cursor.execute(sqlselect % self.url)
----------------

didn't work

thx





More information about the Python-list mailing list