Page 1 of 1

[Tutorial] Reorder Table Columns using the Base GUI

Posted: 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.
Right-click on the Table and select 'Copy'
Right-click on the Table and select 'Copy'
Right-click 'Paste' a new Table
Right-click 'Paste' a new Table
In the Copy table dialog, rename the Table and ensure 'Definition and data' is selected, then click 'Next'
In the Copy table dialog, rename the Table and ensure 'Definition and data' is selected, then click 'Next'

Continued...

Posted: Wed Dec 22, 2010 4:14 am
by DACM
Reorder columns by individual selection, leaving the left panel blank, and click 'Create'
Reorder columns by individual selection, leaving the left panel blank, and click 'Create'
Verify the new Table and data!!! Then re-work any global relationships before deleting the original table...
Verify the new Table and data!!! Then re-work any global relationships before deleting the original table...
Click the 'Add Table' icon
Click the 'Add Table' icon

Continued...

Posted: Wed Dec 22, 2010 4:25 am
by DACM
Add the new Table to the Relationships window
Add the new Table to the Relationships window
Create the same relationships in the new Table, mirroring those of the original Table
Create the same relationships in the new Table, mirroring those of the original Table
Right-click each relationship in the original Table and 'Delete'
Right-click each relationship in the original Table and 'Delete'

Continued...

Posted: Wed Dec 22, 2010 5:18 am
by DACM
Again, after verifying the new Table and data, right-click 'Delete' the original
Again, after verifying the new Table and data, right-click 'Delete' the original
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")
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")
Use the original Table name for compatibility with existing work (Queries, etc.)
Use the original Table name for compatibility with existing work (Queries, etc.)

And finally...

Posted: Wed Dec 22, 2010 5:26 am
by DACM
Reclaim the original database file size using SQL, click Tools > SQL...
Reclaim the original database file size using SQL, click Tools > SQL...
Type CHECKPOINT DEFRAG, then click 'Execute' ...and you're done!!!
Type CHECKPOINT DEFRAG, then click 'Execute' ...and you're done!!!