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

Creating tables and queries

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

Postby Jerold » Tue Nov 20, 2018 9:43 pm

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.
Last edited by Jerold on Thu Nov 22, 2018 2:43 pm, edited 1 time in total.
OpenOffice 4.1.5 on Windows 10 Home
Jerold
 
Posts: 9
Joined: Sun Sep 16, 2018 11:18 pm

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

Postby Villeroy » Tue Nov 20, 2018 9:58 pm

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.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04, no OpenOffice, LibreOffice 6.x
User avatar
Villeroy
Volunteer
 
Posts: 26749
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

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

Postby Jerold » Tue Nov 20, 2018 10:24 pm

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.
OpenOffice 4.1.5 on Windows 10 Home
Jerold
 
Posts: 9
Joined: Sun Sep 16, 2018 11:18 pm

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

Postby Villeroy » Tue Nov 20, 2018 10:56 pm

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.
Last edited by Villeroy on Tue Nov 20, 2018 11:41 pm, edited 1 time in total.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04, no OpenOffice, LibreOffice 6.x
User avatar
Villeroy
Volunteer
 
Posts: 26749
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

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

Postby Jerold » Tue Nov 20, 2018 11:21 pm

"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.
OpenOffice 4.1.5 on Windows 10 Home
Jerold
 
Posts: 9
Joined: Sun Sep 16, 2018 11:18 pm

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

Postby Villeroy » Tue Nov 20, 2018 11:44 pm

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.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04, no OpenOffice, LibreOffice 6.x
User avatar
Villeroy
Volunteer
 
Posts: 26749
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany


Return to Tables & Queries

Who is online

Users browsing this forum: No registered users and 3 guests