Edit: Split from [Solved] Tracing SQL Commands because that topic is solved so you need your own. If you had the same problem you could use the same solution. Please do not post in another's topic unless you are helping to solve their problem for them. |
It is years later but I found this in a search for how to split off a database, so that I could try to upgrade HSQLDB, since what ships with LibreOffice seems to lack many features of SQL. Including 'WITH', the one I specifically want to experiment with here. I get an error that the library is readonly and I am not sure why.0) Make a backup copy of your embedded database.
1) Download the latest HSQLDB and extract it somewhere. Mine is in /usr/local/lib/ or C:\Program Files\ or something. No further installation required.
2) Unzip the database folder out of the odb and rename all files (sript, data, properties) adding some common name prefix (prefix.script, prefix.data, prefix.properties).
3) Download d ... p?id=17008, do NOT extract but install it via Tools>Extensions...[Add...]. It dumps a Basic library FreeHSQLDB into your user profile.
4) Open your odb and call Tools>Macros>Organize>Basic>MyMacros>FreeHSQLDB>FreeHSQLDB>Main which pops up a dialog.
5) Point the tool to lib/hsqldb.jar extracted in step 1).
6) Point the tool to the *.script file extracted and renamed in 2).
7) Save your *.odb, notice the new connection indicated on the status bar and see if your database works as it used to when it was embedded.
Specifically:
Sub SaveDefaultClassPath(sJDCP)
Dim sLine$, oLib
REM Modify module "StoreClassPath"
sLine = "Public Const cClassPath = """& sJDCP &""""
oLib = GlobalScope.BasicLibraries.getByName("FreeHSQLDB")
oLib.replaceByName("StoreClassPath", sLine)
End Sub
The call to replaceByName(...) is what fails. I noticed, as well, that the extension added FreeHSQLDB to 'LibreOffice Macros' and not to 'My Macros'. It did that automatically. Maybe this extension does not work with LibreOffice, or not with version 7+?
If anyone sees this and knows how to correct this problem I would be grateful to learn. Thanks.