Base error code issue

Can anyone help interpret the error code I am getting. It is for a very simple single table database which works fine for a few entries; all saved records, close and reopens fine then after a another entry will then show the following when opening the data base file:

SQL Status: S1000
Error code: 40

S1000 General error java.lang.NullPointerException in statement [SELECT * FROM “ProductStock”]

A quick Google search for that error message seems to show a variety of possible reasons - most which are over my head :slight_smile:
However, it seems that some kind of database corruption may be a cause. Base has known to be somewhat unstable at times and having regular backups is recommended. Here are a couple of things you might want to try:

Got to Tools / SQL… and execute these commands — Shutdown Compact then close and reopen your database. Might also try Checkpoint Defrag.

Another possibility is noted in the post – http://www.mail-archive.com/users@openoffice.org/msg85626.html
Basically it says to ensure that there are no null values in the first row.

Good luck!

thank you for
“Got to Tools / SQL… and execute these commands — Shutdown Compact then close and reopen your database”
it worked for me.
yours`
sehrguey

You don’t mention which version of LO you are using or even how your database is configured. Presumably you are simply using the standard HSQLDB v1.8 in an embedded manner, which is the default method. Finding error codes for HyperSQL requires looking at the source code as there do not appear to be any listings on the website.

Error codes for HSQLDB v1.8 can be found in /src/org/hsqldb/Trace.java but unfortunately error code 40 (line 160) is a general error, which is why the causes are variable as @JohnD indicates. This same contextual error (NullPointerException) has been around a long time as this Red Hat bug comment shows. That bug also indicates it is not always easy to reproduce.