Search This Blog

Thursday, September 15, 2016

Modifying the column layout of an existing OpenOffice™ Base table

A contribution by Axel Drefahl, axeleratio.com, September 15, 2016.


My recent posts “Exploring OpenOffice™ Base” and “Structuring rare-earth mineral data in an OpenOffice™ Base table” demonstrated how to get started with Open Office™ Base (ooBase) and create tables by developing them in design view and then entering data in spreadsheet view (data view).

Before you start defining relations between tables, you want to have their design (layout) being finished. In case you still want to add new columns (fields) to a table, you may will preferably append those to the existing ones before tying them up in relations.

There seems to be no way to directly insert columns between existing ones. Although column order (field order) does not matter structurally in a relational database, you may want a data-oriented column order in your spreadsheet view. This can be achieved indirectly by appending fields to an existing table, copying the table, rearranging its fields and then copying it back.

Let's walk through this by inserting a hasTi (for “has titanium”) column between hasLu and MinClassID in the CesbromList table. We use RareEarthMinerals_2tables.odb. Here are the steps:
  1. Open RareEarthMinerals_2tables.odb and click Tables in the left-side Database pane to open the Tables pane.
  2. In the Tables pane, right-click CesbronList to see the context menu: click Edit to open the table in design view.
  3. Add the Field Name hasTi with Field Type Yes/No [ Boolean ] into the first emoy row and Close the table.
  4. Back in the Tables pane, again right-click CesbronList, select Copy and then—still in the context menu—select Paste Special.
  5. In the Paste Special pop-up window select Data source table and press the OK button.
  6. In the opened Copy table window stay with the suggested table name CesbronList2 and with the option Definition and data and click Next>
  7. In the opened Apply columns dialog transfer the shown existing columns on the left to the right in the desired order and press the Create button when done.   
  8. In the Tables pane, right-click CesbronList and Delete it; then right-click CesbronList2 and Rename it to CesbronList. Voilà!


No comments:

Post a Comment