How can I see the structure (details of the columns etc) of a table in HSQLDB? It is not "desc" like Oracle, so what?
So desc or describe command shows the structure of table which include name of the column, data-type of column and the nullability which means, that column can contain null values or not.
To show table properties in the Properties window. In Object Explorer, select the table for which you want to show properties. Right-click the table and choose Properties from the shortcut menu. For more information, see Table Properties - SSMS.
If we want to show the structure of a database table or tables in the server then, we will use the SQL command DESCRIBE or other keyword DESC, which is identical to DESCRIBE one.
The information is provided by the views in the INFORMATION_SCHEMA
SELECT * FROM INFORMATION_SCHEMA.SYSTEM_TABLES
SELECT * FROM INFORMATION_SCHEMA.SYSTEM_COLUMNS
In version 2.x, additional views are available containing more detailed information:
SELECT * FROM INFORMATION_SCHEMA.TABLES
SELECT * FROM INFORMATION_SCHEMA.COLUMNS
You can select from single or joined views and filter the results on schema, table, column names and table type. The last you can use to show non-system tables only.
SELECT * FROM INFORMATION_SCHEMA.SYSTEM_TABLES where TABLE_TYPE='TABLE'
I use following query in HSQLDB to see column information of a particular table:
SELECT * FROM INFORMATION_SCHEMA.COLUMNS where table_name = '<TABLE_NAME>'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With