Hello everybody I am learning DB2 and would like to know how to see a table's characteristics after I create one.
Similar to the EXPLAIN TABLE command in MySQL.
Thank you.
Hello everybody I am learning DB2 and would like to know how to see a table's characteristics after I create one.
Similar to the EXPLAIN TABLE command in MySQL.
Thank you.
Try the following:
Syntax for Describe table
or For all table details
or For all table details
DB2 Version 11.0
I know this is an old question, but this will do the job.
In addition to
DESCRIBE TABLE
, you can use the command belowto get information about the table's indexes.
The most comprehensive detail about a table on Db2 for Linux, UNIX, and Windows can be obtained from the db2look utility, which you can run from a remote client or directly on the Db2 server as a local user. The tool produces the DDL and other information necessary to mimic tables and their statistical data. The docs for db2look in Db2 11.5 are here.
The following
db2look
command will connect to the SALESDB database and obtain the DDL statements necessary to recreate the ORDERS tabledb2look -d <db_name> -e -z <schema_name> -t <table_name> -i <user_name> -w <password> > <file_name>.sql
For more information, please refer below: