How to list all the tables available in a current database?
Hi developers!
What is the way using SQL to list all the tables available in the current database/namespace?
Product version: IRIS 2022.3
Hi developers!
What is the way using SQL to list all the tables available in the current database/namespace?
You can do this query
SELECT TABLE_SCHEMA, TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE='BASE TABLE'
Filter by TABLE_TYPE is to get rid of system tables
Hi @Evgeny Shvarov,
List of Tables can be listed by using the below query against all or specific schema:
SELECT TOP 5 * FROM INFORMATION_SCHEMA.TABLES --WHERE TABLE_NAME LIKE '%CSP%'
While Columns details can be listed by using the below query:
SELECT TOP 5 * FROM INFORMATION_SCHEMA.COLUMNS --WHERE TABLE_NAME LIKE '%CSP%' --AND TABLE_SCHEMA LIKE '%CSP%'
Thanks
call %Library.SQLCatalog_SQLTables()
how about this?
This may require additional privileges