user1304228
user1304228

Reputation: 189

ADODBAPI SQL query

I have a python SQL query which is intended to call a procedure and then return that query in results however with the below code I only get this output:

adodbapi.adodbapi._SQLrows object at 0x0000000004CDE278

instead of it selecting the rows and data that it should be grabbing, I don't know anything about SQL and limited python so be gentle :)

# Connect to the SQL DB

conn = adodbapi.connect("Provider=SQLOLEDB; SERVER=xx.x.x.x; Initial Catalog=master_db;User Id=User; Password=Pass; ")
curs = conn.cursor()

# Execute SQL procedure "

curs.execute('util.referencing_procedure', )
results = curs.fetchall()

print results


conn.close()

Upvotes: 0

Views: 5726

Answers (1)

Daniel Roseman
Daniel Roseman

Reputation: 599866

You need to iterate through the results. Probably:

for row in results:
    print row

Upvotes: 1

Related Questions