I have an existing database with over 1000 entries. I now need to add a further column to the database but I cannot find any way of doing this. I have got round the immediate problem by saving the database as a spreadsheet and manipulating that - but of course it doesn't give me all the functionality of a database.
Is there any way of modifying the database please?
Adding a column to an existing database
Adding a column to an existing database
CRB Open Office 4.1.5 Windows 10
-
- Volunteer
- Posts: 1549
- Joined: Wed Jun 24, 2015 12:56 am
- Location: Colorado, USA
Re: Adding a column to an existing database
Look in the lower left corner of the main database window. If you are using an Embedded database connection you have two options.
In the Tables area of the main database window right click on the table name and select Edit to open the table design GUI.
The following should work with Embedded and most other connection types
Select Tools>SQL, enter and execute a command in the following format
for example
In the Tables area of the main database window right click on the table name and select Edit to open the table design GUI.
The following should work with Embedded and most other connection types
Select Tools>SQL, enter and execute a command in the following format
Code: Select all
ALTER TABLE "Table Name" ADD COLUMN "Column Name" [Data Type] [Optional Constraint];
Code: Select all
ALTER TABLE "MyTable" ADD COLUMN "ProductDesc" VARCHAR(50);
ALTER TABLE "MyTable" ADD COLUMN "Price" DECIMAL(10,2) NOT NULL;
If your problem has been solved, please edit this topic's initial post and add "[Solved]" to the beginning of the subject line
Apache OpenOffice 4.1.14 & LibreOffice 7.6.2.1 (x86_64) - Windows 10 Professional- Windows 11
Apache OpenOffice 4.1.14 & LibreOffice 7.6.2.1 (x86_64) - Windows 10 Professional- Windows 11
Re: Adding a column to an existing database
Also asked at
https://ask.libreoffice.org/en/question ... base-file/
https://ask.libreoffice.org/en/question ... base-file/
Apache OpenOffice 4.1.15 on Xubuntu 22.04.4 LTS