Page 1 of 1

[Solved] Can I start SQL from command line and pass commands

PostPosted: Tue Nov 20, 2018 9:43 pm
by Jerold
Running Base 4.1.5 on Windows10.

Can I start SQL from the command line and pass it commands from a txt file?
...................................................................................................
I downloaded http://cpap.com.br/orlando/SendKeysMore.asp.
This Sendkeys.exe works very well.

Re: Can I start SQL from the command line and pass it cmmand

PostPosted: Tue Nov 20, 2018 9:58 pm
by Villeroy
Download and extract the package from http://hsqldb.org.
Convert your embedded HSQLDB into a stand-alone HSQLDB. Now you have a database directory as backend and a Base document as frontend.
Read the documentation on sqltool which is a command line interface for HSQL.

Re: Can I start SQL from the command line and pass it cmmand

PostPosted: Tue Nov 20, 2018 10:24 pm
by Jerold
Villeroy wrote:Download and extract the package from http://hsqldb.org.
Convert your embedded HSQLDB into a stand-alone HSQLDB. Now you have a database directory as backend and a Base document as frontend.
Read the documentation on sqltool which is a command line interface for HSQL.


Seems like a lot of work for such a simple request.

Re: Can I start SQL from the command line and pass it cmmand

PostPosted: Tue Nov 20, 2018 10:56 pm
by Villeroy
I don't even know which database you are using, so I guess, it might be an embedded HSQLDB. This special database has no interfaces to the world outside the office suite. It is a good enough database for your private stuff and for learning SQL stuff if you also have a good backup strategy for the Base document (see today's topic https://forum.openoffice.org/en/forum/v ... 13&t=95938). The embedded database is NOT good enough for anything important. You have to turn it into a stand-alone database anyway.

This should be doable within 5 minutes:
0) Get the hsqldb package. It's a zip.
1) copy your odb into a directory.
2) Create a subdirectory "driver" and copy or link the lib/hsqldb.jar from the downloaded package into this subdirectory.
3) Open my odt document to install the Python macro. The odt includes a Basic routine as installer.
4) Open the document of step 1) and run the macro. You find it under Tools>Macros>Run... pyDBA/ExtractHSQLDB/Main
5) Test your queries, forms and reports in the Base document. In most cases they work flawlessly. You still have the original document and you can also decide to close this copy without saving which preserves the embedded database.

Once the thing is extracted out of the Base container, the door to a world of database applications is wide open. Connecting the Base document to a local database directory and using a recent version of HSQL gives you instant access to external tools, more functionality and more safety because the database won't be destroyed when something bad happens to the office suite. Nevertheless, you know how important a decent backup strategy is.
Turning this stand-alone database into a full featured server database for multi-user access (possibly through a web site or a group of Base users on the local net) is possible but takes some work indeed.

Re: Can I start SQL from the command line and pass it cmmand

PostPosted: Tue Nov 20, 2018 11:21 pm
by Jerold
"Open my odt document to install the Python macro. The odt includes a Basic routine as installer"

I cannot find the odt document. I presume it is somewhere in the extracted HSQLdb folder?
I apprciate your help.

Re: Can I start SQL from the command line and pass it cmmand

PostPosted: Tue Nov 20, 2018 11:44 pm
by Villeroy
The attachment of the topic I have linked is a text document with the Python code and a Basic installer which drops that code to the right place.
https://forum.openoffice.org/en/forum/v ... 21&t=86071 is the topic with a full description and attachment.