I need to script the insertion of records into a database. For this project (my first such), I'm using libreoffice Base with, for no particular reason, an HSQLDB back-end. Is there a cli interface that would let me do that?
1 Answer
The easiest way to manipulate a HSQLDB database by means of scripts would be to use the tool sqltool
provided in the package. You can do things like:
hsqldb-sqltool urlid --SQL="SQL statement 1; SQL statement 2; ..."
(where urlid
is a file containing connection details), or read a bunch of SQL statements from a file, like this:
hsqldb-sqltool urlid file1.sql
NB: As @tohuwawohu points out, the database needs to be set up as a server to access it this way, rather than as "embedded", which is the first thing LibreOffice Base offers.
hsqldb-utils
. The command to start it ishsqldb-sqltool
.