[Solved] Exporting a list of tables and fields
[Solved] Exporting a list of tables and fields
I would like to export a list of all the tables and the field-names they contain, no data. Could be as .csv or .ods or else. Is this possible?
Last edited by Yumi on Tue Jun 25, 2024 4:52 am, edited 1 time in total.
OOo 4.1.6 on Linux Mint 19.1 Tessa
Re: Exporting a list of tables and fields
You have not told us in this post, which database backend you are using . . . therefore . . . I will assume you are using HSQL.
You can create a Query as defined below . . . and . . . since you have a registered database ( I presume ), import it to Calc . . . and / or . . . save it as a CSV, or, ODS file.
I hope this helps, please be sure to let me / us know.
Sliderule
Thanks to add [Solved] in your 1st post Subject (edit button top right) if this issue has been resolved.
You can create a Query as defined below . . . and . . . since you have a registered database ( I presume ), import it to Calc . . . and / or . . . save it as a CSV, or, ODS file.
Code: Select all
Select
SYS_TABLES."TABLE_TYPE" as "TABLE or VIEW",
'"' || SYS_TABLES."TABLE_NAME" || '"' as "TABLE NAME",
SYS_COLUMNS."ORDINAL_POSITION" as "COLUMN POSITION",
'"' || SYS_COLUMNS."COLUMN_NAME" || '"' as "COLUMN NAME",
SYS_COLUMNS."TYPE_NAME" as "TYPE NAME",
SYS_COLUMNS."COLUMN_SIZE" as "COLUMN SIZE"
From "INFORMATION_SCHEMA"."SYSTEM_TABLES" as SYS_TABLES,
"INFORMATION_SCHEMA"."SYSTEM_COLUMNS" as SYS_COLUMNS
Where SYS_TABLES."TABLE_SCHEM" = 'PUBLIC'
and SYS_TABLES."TABLE_TYPE" IN ( 'TABLE', 'VIEW')
and SYS_TABLES."TABLE_NAME" = SYS_COLUMNS."TABLE_NAME"
Order By SYS_TABLES."TABLE_TYPE",
'"' || SYS_TABLES."TABLE_NAME" || '"',
SYS_COLUMNS."ORDINAL_POSITION"
Sliderule
Thanks to add [Solved] in your 1st post Subject (edit button top right) if this issue has been resolved.
Re: Exporting a list of tables and fields
It works without any modifications. Thanks for this advice and sorry to rely on your assumptions. It will help to bring different databases together and create a overview.
OOo 4.1.6 on Linux Mint 19.1 Tessa
Re: Exporting a list of tables and fields
With this OXT, the export in CSV made easy
Co-admin french forum branch
Re: [Solved] Exporting a list of tables and fields
Bidouille:
Thanks for your suggestion of OXT extension.
I am sending you a PM ( Private Message ) .
Sliderule
Thanks for your suggestion of OXT extension.
I am sending you a PM ( Private Message ) .
Sliderule