当我执行查询“请描述ARADMIN.EPM_TechnicianInformation”时,如下所示:
connection = cx_Oracle.connect(user=username, password=userpwd, dsn=dsn, encoding="UTF-8")
cursor = connection.cursor()
results = cursor.execute(" DESCRIBE ARADMIN.EPM_TechnicianInformation")它是给予
DatabaseError: ORA-00900: invalid SQL statement如何使用ARADMIN.EPM_TechnicianInformation创建查询"DESCRIBE ARADMIN.EPM_TechnicianInformation“?我想要这张表的列细节。
请帮帮我!谢谢!
发布于 2021-09-13 11:09:52
'desc‘命令是一个SQL*Plus命令,而不是数据库或cx_Oracle所理解的。
请检查关于游标描述属性的cx_Oracle文档。
您可以尝试以下方法:
# sql for column details
sql = "SELECT * from ARADMIN.EPM_TechnicianInformation"
cursor.execute(sql)
print(cursor.description)
# This will print out the column description as a list, with each item referring to each column.发布于 2021-09-13 10:27:37
从甲骨文中读取,cx_Oracle不理解SQL的特定语句
您可以尝试通过以下操作获取所需的信息:
SELECT * FROM ALL_TABLES WHERE OWNER= 'ARADMIN' AND TABLE_NAME = 'EPM_TechnicianInformation'这也会给你提供桌上的信息。
https://stackoverflow.com/questions/69160458
复制相似问题