I interface a website with a DB2 database and an SQL database and this is the first time I need to actually get a list of libraries and tables from the AS/400.
Please illustrate how I can get this list.
I have an ODBC connection to two libraries:
DATALIB
CUSTLIB
would like to know how to get a list of Tables from the selected library. Maybe Even a list of libraries first.
Select the Table (File) and get the (fields) structure of those items. I know how to do this with SQL but am a little lost with DB2. Usually I can get by. Please assist if you can.
I have tried some of these: Maybe I don't have enough clearance to run them, dunno.
Select tabschema, tabname from syscat.tables
SELECT NAME FROM SYSIBM.SYSTABLES
SELECT distinct table_schema FROM CUSTLIB/systables
SELECT * FROM DICTIONARY.TABLES where libname = 'CUSTLIB'
SELECT SYSTEM_TABLE_SCHEMA, SYSTEM_TABLE_NAME FROM SYSTABLES ORDERBY SYSTEM_TABLE_SCHEMA
I don't get squat.
Please illustrate how I can get this list.
I have an ODBC connection to two libraries:
DATALIB
CUSTLIB
would like to know how to get a list of Tables from the selected library. Maybe Even a list of libraries first.
Select the Table (File) and get the (fields) structure of those items. I know how to do this with SQL but am a little lost with DB2. Usually I can get by. Please assist if you can.
I have tried some of these: Maybe I don't have enough clearance to run them, dunno.
Select tabschema, tabname from syscat.tables
SELECT NAME FROM SYSIBM.SYSTABLES
SELECT distinct table_schema FROM CUSTLIB/systables
SELECT * FROM DICTIONARY.TABLES where libname = 'CUSTLIB'
SELECT SYSTEM_TABLE_SCHEMA, SYSTEM_TABLE_NAME FROM SYSTABLES ORDERBY SYSTEM_TABLE_SCHEMA
I don't get squat.