Ask Your Question
1

Need an sql command to view the table structure in Base.

asked 2016-11-25 01:18:24 +0200

Quarto Die gravatar image

I would like to view the structure of my tables (without data) and print them out eventually or copy them to where they can be printed in order to see on paper the two or three tables compared to one another. Is this possible. I have tried using:

1

SELECT * FROM information_schema.columns WHERE table_name = 'Table_Name' ORDER BY ordinal_position

and #2 DESC or DESCRIBE : Used to describe the table structure present in the tablespace.

Both of these seem to have failed. I don't find that this seems to be possible in Base

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
2

answered 2016-11-25 02:34:28 +0200

Ratslinger gravatar image

updated 2016-11-25 03:20:54 +0200

It looks like your problem stems from the HSQL version you are using. The embedded version which comes with Base does not work with that select statement. This statement:

SELECT * FROM "INFORMATION_SCHEMA"."COLUMNS" WHERE "TABLE_NAME" = 'TEST1' ORDER BY "ORDINAL_POSITION"

works in HSQL 2.x or later. If you are not already using a 'split DB' you may want to consider this: click here. If you already are using a split DB, just upgrade to a later version of HSQL.

Edit:

Using the embedded HSQL, use the following statement:

SELECT * FROM INFORMATION_SCHEMA.SYSTEM_COLUMNS WHERE TABLE_NAME = 'ISSUE2' ORDER BY ORDINAL_POSITION
edit flag offensive delete link more

Comments

To my knowledge, DESCRIBE is not supported in HSQL.

Ratslinger gravatar imageRatslinger ( 2016-11-25 03:44:16 +0200 )edit

Thanks, it worked. Thanks also for the link about the 'split DB'. I will see what I can do.

Quarto Die gravatar imageQuarto Die ( 2016-11-25 05:52:12 +0200 )edit
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2016-11-25 01:18:24 +0200

Seen: 669 times

Last updated: Nov 25 '16