Where do I find the SQL code generated by the creation of tables

Hi all
My configuration: LO 25.8.4.2
MacOS
I would like to check the SQL code for references purposes.
TIA
Nick

Depends on the database you are working with. Do you use internal HSQLDB? Then: Open the *.odb-file in a zip-app. Search for database → script. There could be seen the whole code for creating tables.

Hi Robert
Thanks for your quick response.
I couldn’t find an unzipper able to unzip this file which is not an archive.
Isn’t there a feature inside Base that displays the code?
Nick

Couldn’t find any feature inside of Base, which will show the code to create tables.
.
Here, with Linux, the default zip-tool ark will show the whole content of any LibreOffice file, which are all archives. Might be it would help to rename a copy of your Database.odb and rename it to Database.zip.
.
Might also be Base Guide would help (for SQL, also for the system tables of HSQLDB…):

All office documents (*.od?) are zip archives. Within the zip archive, the script file in folder “database” has the script which generated your embedded HSQL database.
You can also call menu:Tools>SQL… and execute SCRIPT, which dumps the script into the document directory.

I am on a Mac so I am afraid those solutions are not available.
Nick

Perhaps this page on the Mac User Guide will be of some help. You may have to rename to .zip.

@Holly112 : Please note what @Villeroy wrote: Start the Base file. Go to Tools → SQL… and write SCRIPT as command. You will get the result as output.

Since MacOS is not Windows, unzip MyDB.odb database/script should work as well.

You can use a zip archive gui tool to unpack an ODB file and then be able to read the SCRIPT file, which you might have to add a .txt filename extension to (so that it opens with the text reader app.

However, you should only do this on a copy of the ODB file because the most commonly available zip tools on macOS will not correctly rezip the file, and you’ll be left with a broken ODB file.

Thanks for the tips but as a matter of fact my tests with Base are not convincing. I’ll look for another soft.
Thanks again for your help.

Sorry, but this may be ablimitation for some MacUsers, not for MacOS itself.

You never told, what you actually wants to achieve. LibreOffice is not the best software for database administration, but Base makes databases accessible for LibreOffice/Openoffice.
.
I usually have a second Tool like Sqlite-Studio or HeidiSQL (for MariaDB) ready for some tasks.
.
The default embedded HSQLDB is nice to do some first steps, but I don’t recommend this for production.

You never mentioned the type of database you are using with Base. Therefore, given answers may not work for the simple reason that we are talking about different software.

@ Holly112: Yepp - rename the file (or a copy of it rather) from .od? to .zip - same as one would do with Microsoft files (since they are, too, zip-files in the end).

But - when you are on a Mac, shouldn’t you consider “out of the box” solutions, like TablePlus, DBeaver or SQLPro Studio?
They should be available on Mac, and e.g. DBeaver is a light yet powerful freeware that handles e.g. SQLite very easily, and you can design your databases just as fine.
The interesting part comes when you want to do create forms, reports and the like - then I see a definite benefit in LO Base.