I want to access my database by using python script .
I can able to access all table by using
SELECT * FROM poorvika1.payment;
But i want to access the query by using VIEW Statement
SELECT * FROM poorvika1.pymentview;
This is my python script
import pyodbc
for py in pyodbc.drivers():
print(py)
connection =pyodbc.connect(driver='SQL Server',server='localhost',database='test',uid='test',password='root')
cursor = connection.cursor()
for row in cursor.tables():
print(row.table_name)
This Query is not working
cursor.execute('SELECT * FROM poorvika1.pymentview')
I want to access view query in pyodbc package
did you tried