ODBC Driver for 1010data

Build 22.0.8509

Discovering Schemas

The following sections show how to obtain schema information.

List Tables and Views

You can use the tables method to discover what tables and views are available through the driver. This returns results on the cursor like a query would.

cursor.tables()
for (catalog, schema, table, table_type, description) in cursor:
    print("Catalog: {}, Schema: {}, Table: {}, Type: {}".format(
        catalog, schema, table, table_type
    ))

You can use the columns method to discover what columns are available on a table or view.

cursor.columns("solar","tenten","public")
for row in cursor:
    print("Name: {}, Type: {}, Length: {}, Precision: {}, Nullable: {}".format(
        row[3], row[5], row[6], row[8], row[17]
    ))

Copyright (c) 2023 CData Software, Inc. - All rights reserved.
Build 22.0.8509