Can I safely add a column to an in-use table?

This has to be a fundamental question but the answer is critical to me and I don’t know it. I have an ODB database. It includes a table that is populated with rows, and is used for a “production” form and a “production” report.

Can I add a column to the table without disturbing the existing rows, form and report?

I would think that the answer is Yes but for obvious reasons I want to be sure.

Thanks much for your patience with a newbie.

Charles

Hope the table hasn’t been opened for input data since you try to add a column.

Adding a column won’t disturb existing rows, existing forms and existing reports. But special in forms and in reports you have to add a new field to see the content of this new column.

Yes, but be sure to save a backup copy of your database in case something goes wrong or you don’t like the results, you can easily go back.

Thanks all! Yes, I am a newbie at Base but experienced enough to know that adding a column to a table does not magically add a corresponding field to the reports. I am experienced enough to know that backups are your friend. And I am hoping that “default value” will set a value for all existing rows when I add the column.

Unfortunately, you might find that it doesn’t.

Yeah, I am experienced enough to know that Hope is not a technical specification.

1 Like

Default value works for new rows but does not seem to update old.

To update all the rows to a single value, from the menu select Tools>SQL
Enter a command of the form
UPDATE "your_table_name" SET "your_new_column_name" = Some Value
When you execute that command you should see a message as to the number of rows that were updated.
From there as you found the default value should update any new rows,

Thanks! That is helpful. I “solved” it by using IFNULL() in the query but this is cleaner.