I tried to get data from nc_all_users using pyodbc where only cursors are available for tetch data. Unfortunatelly AsterDB returned error:
('HY000', '[HY000] [AsterData][nCluster] (34) ERROR: declare cursor statement may not reference system tables. (34) (SQLFetch)')
Any idea how to get data from system tables using Python?
This same problem with jdbc driver - SELECT is internally conversed to cursor and access to system tables is forbidden. Does it mean that ASTER do not provide programatic interface to manage user, databases, schemas?
The ODBC driver provides possibility to use SQL without cursor and works ok in this case, but pyodbc and Teradata JDBC driver base on cursors only what leads to meaningful limitations of these access vectors. Is it possible to use cursors on system tables or does Teradata plan to add direct access to data in new version of JDBC or Python Teradata driver will also support Aster?
I'm unsure on the why, but Aster requries that AutoCommit be on to access the system tables. To get around your error message use autocommit=True in the connection step:
aster = pyodbc.connect('DSN=NAME',autocommit=True) get_aster = aster.cursor() query_aster = """ select colname, coltype from nc_all_columns as c """ rows_aster = get_aster.execute(query_aster).fetchall()