Programming with SQL Relay using the Python DB API

The Python DB module is PySQLRDB. The DB API doesn't have the concept of retrieving specific fields, so instead we just retrieve the first 99 rows and print the values.

from SQLRelay import PySQLRDB

cursor = PySQLRDB.connect('testhost', 9000, '', 'testuser', 'testpassword')
cursor.execute('select column_name from user_table')

# get the first 99 rows
for i in cursor.fetchmany(99):
    for field in i:
        print field