[Tutorial] Reorder Table Columns using the Base GUI

Forum rules
No question in this section please
For any question related to a topic, create a new thread in the relevant section.
Post Reply
User avatar
DACM
Volunteer
Posts: 1138
Joined: Tue Nov 03, 2009 7:24 am

[Tutorial] Reorder Table Columns using the Base GUI

Post 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'
Last edited by DACM on Mon Feb 11, 2013 6:56 pm, edited 7 times in total.
User avatar
DACM
Volunteer
Posts: 1138
Joined: Tue Nov 03, 2009 7:24 am

Continued...

Post 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
Last edited by DACM on Wed Jan 05, 2011 7:15 am, edited 3 times in total.
User avatar
DACM
Volunteer
Posts: 1138
Joined: Tue Nov 03, 2009 7:24 am

Continued...

Post 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'
User avatar
DACM
Volunteer
Posts: 1138
Joined: Tue Nov 03, 2009 7:24 am

Continued...

Post 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.)
Last edited by DACM on Thu Mar 15, 2012 12:01 pm, edited 2 times in total.
User avatar
DACM
Volunteer
Posts: 1138
Joined: Tue Nov 03, 2009 7:24 am

And finally...

Post 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!!!
Post Reply