1

Is there a way to send an SQL query to HSQLDB (edit : prior to version 2) to know the columns of a certain table ? (Similar to the inspection of the schemas through INFORMATION_SCHEMA in MySQL.)

Right now it seems to me I'm stuck with trying to SELECT column_name FROM table_name and see if I get an SQL error...

glmxndr
  • 45,516
  • 29
  • 93
  • 118

2 Answers2

2

HSQLDB supports the INFORMATION_SCHEMA as well:

http://hsqldb.org/doc/2.0/guide/databaseobjects-chapt.html#dbc_information_schema

fredt
  • 24,044
  • 3
  • 40
  • 61
  • Hmm ok, I'm having an old version of HSQLDB then. :) – glmxndr Jun 24 '11 at 09:03
  • Versions of HSQLDB since 1.8 support INFORMATION_SCHEMA. The table you should query is INFORMATION_SCHEMA.SYSTEM_COLUMNS. Even older versions support the same table but no schemas. – fredt Jun 24 '11 at 09:20
1

You use queries to the special SYSTEM tables. See the answers to [this question].1

Community
  • 1
  • 1
Kilian Foth
  • 13,904
  • 5
  • 39
  • 57