How do I add a column to my database?

I can’t find anything that allows me to add another column to my database, I’ve checked the help for help and that tells my what it is, but not where it is.

So where is this option?

Your question is not very clear or readily understandable.

You can’t add a column to a database.

IF you mean how do I add another column to my TABLE in my database then the answer is straightforward.

Click on Tables in the LH window of the GUI which has the title Database

Right click on your table

Select EDIT from the drop down window.

You’ll be presented with a window which displays Field Names (columns) & Field Types

Click in the leftmost column of the first empty row and enter the details of your filename & type

Close the window - you’;ll be asked if you want o save the changes - reply YES.

Your table will now have an extra field (column)

HTH if it doesn’t please try rewriting your question and explaining exactly what it is you are trying to do.

I did that, and an error came up saying "Column constraints are not acceptable in statement [ALTER TABLE “Table name” ADD “Field Name” BOOLEAN NOT NULL]

What do I do now?

Hi

This is a limitation of HSQLDB 1.8 engine: A not-null constraint can only be added if the table data for the column has no null values.

So with UI (Right click a table Edit) create without Enry required, then update data (yes/no), then you can add Entry required. Or you can use Tools SQL to execute:

ALTER TABLE "Table name" ADD "Field name" BOOLEAN DEFAULT 0 NOT NULL

If this answers the question, thank you to click on the :heavy_check_mark: to mark it ANSWERED.

Regards

Interesting in that following your method it works but in the UI the default entry has to be Yes or No, which is logical as they are the only options if NULL is not allowed - defaulting to No. I guess that setting a default entry without entry required would produce the same result.

From the description of the error message I think you were trying to add a BOOLEAN Yes/No field in a Table. I have replicated the error you get in doing this if I set the field to require an entry and not be NULL. The alternative, if you do require an entry in the field is to set a default value to Yes or No so there will always be an entry in the field.

a simple way, if you use a form to fill the field, is you just make a new table with a single column where you put only
a field “yes” and a field “no” and close it. Edit your form, separate the field name from the label (ctrl-click, then “delete”) and with a button “create a list zone” on your left, vertical Menu zone, indicate the table you just have created
(choosing in the “control” window you access by right-clicking) and take the opportunity to set size and colour of the font, and eventually the background and all you want to set-up.