Page 1 of 1

[Tutorial] Reorder Table Columns using the Base GUI

PostPosted: Wed Dec 22, 2010 4:08 am
by DACM
The following method utilizes the Base GUI to reorder Table columns/fields. These steps apply to the default "Embedded database" utilizing the "HSQL database engine" as reflected in the Base status bar. Additional steps or workarounds may be necessary with non-embedded (external/existing/split) databases. Either way, this is not the expert approved method so backup your .odb file before proceeding.

Reorder_Columns_02.jpg
Right-click on the Table and select 'Copy'

Reorder_Columns_03.jpg
Right-click 'Paste' a new Table

Reorder_Columns_04.jpg
In the Copy table dialog, rename the Table and ensure 'Definition and data' is selected, then click 'Next'

Continued...

PostPosted: Wed Dec 22, 2010 4:14 am
by DACM
Reorder_Columns_05.jpg
Reorder columns by individual selection, leaving the left panel blank, and click 'Create'

Reorder_Columns_24.jpg
Verify the new Table and data!!! Then re-work any global relationships before deleting the original table...

Reorder_Columns_20.jpg
Click the 'Add Table' icon

Continued...

PostPosted: Wed Dec 22, 2010 4:25 am
by DACM
Reorder_Columns_21.jpg
Add the new Table to the Relationships window

Reorder_Columns_22.jpg
Create the same relationships in the new Table, mirroring those of the original Table

Reorder_Columns_23.jpg
Right-click each relationship in the original Table and 'Delete'

Continued...

PostPosted: Wed Dec 22, 2010 5:18 am
by DACM
Reorder_Columns_08.jpg
Again, after verifying the new Table and data, right-click 'Delete' the original

Reorder_Columns_09.jpg
Right-click 'Rename' the new Table (or re-accomplish the Table copy process above to rename non-embedded database Tables; or perhaps use Tools > SQL... to Execute: ALTER TABLE "OldName" RENAME TO "NewName")

Reorder_Columns_11.jpg
Use the original Table name for compatibility with existing work (Queries, etc.)

And finally...

PostPosted: Wed Dec 22, 2010 5:26 am
by DACM
Reorder_Columns_13.jpg
Reclaim the original database file size using SQL, click Tools > SQL...

Reorder_Columns_14.jpg
Type CHECKPOINT DEFRAG, then click 'Execute' ...and you're done!!!