Better ways to print out column names when using cx_Oracle

后端 未结 3 904
感动是毒
感动是毒 2021-02-01 08:39

Found an example using cx_Oracle, this example shows all the information of Cursor.description.

import cx_Oracle
from pprint import pprint

connec         


        
3条回答
  •  情深已故
    2021-02-01 08:44

    The SQLAlchemy source code is a good starting point for robust methods of database introspection. Here is how SQLAlchemy reflects table names from Oracle:

    SELECT table_name FROM all_tables
    WHERE nvl(tablespace_name, 'no tablespace') NOT IN ('SYSTEM', 'SYSAUX')
    AND OWNER = :owner
    AND IOT_NAME IS NULL
    

提交回复
热议问题