【发布时间】:2017-09-25 12:32:37
【问题描述】:
我按照link 查询 Azure 数据库。
import pyodbc
server = 'your_server.database.windows.net'
database = 'your_database'
username = 'your_username'
password = 'your_password'
driver= '{ODBC Driver 13 for SQL Server}'
cnxn = pyodbc.connect('DRIVER='+driver+';PORT=1433;SERVER='+server+';PORT=1443;DATABASE='+database+';UID='+username+';PWD='+ password)
cursor = cnxn.cursor()
cursor.execute("SELECT * FROM FinancialRecord where deleted=0")
row = cursor.fetchone()
while row:
print (str(row[0]) + " " + str(row[1]))
row = cursor.fetchone()
当我运行上面的代码时,它会显示错误。
Traceback(最近一次调用最后一次): 文件“sqltest.py”,第 10 行,在 行 = cursor.fetchone() pyodbc.ProgrammingError: ('ODBC SQL type -155 is not yet supported. column-index=2 type=-155', 'HY106')
我是 Azure 的新手。有人可以帮忙吗?
【问题讨论】:
标签: python sql-server azure-sql-database pyodbc