23
2009
Change column / field order in OpenOffice Base ( HSQL )
Altering the sequence of fields of a table was a feature I was looking for in OpenOffice Base. It is not directly possible to drag the columns or fields and alter their sequence.
A SQL workaround can do the same thing.
If the sequence of fields is :
name , email , address , phone
and phone is to be brought before address like this :
name , email , phone , address
then the sql for this should be
1. ALTER TABLE “tablename” ADD COLUMN “phone2″ INTEGER BEFORE “address”
2. UPDATE “tablename” SET “phone2″ = “phone”
3. ALTER TABLE “tablename” DROP COLUMN “phone”
4. ALTER TABLE “tablename” ALTER COLUMN “phone2″ RENAME TO “phone”
Then View > Refresh Tables in the top menu. And open the table again for viewing.
The sequence should now be name , email , phone , address
Popularity: 7% [?]
Leave a comment
Subscribe
Recent Posts
- Compile wxwebconnect on Ubuntu 11.04 64 bit
- Disqus Comments Importer Script in PHP
- Beginners’ guide to socket programming with winsock
- Handle multiple socket connections with fd_set and select on Linux
- Beginners guide to socket programming in C on Linux
- Gui whois client in python with wxpython
- Whois client code in C with Linux sockets
- str_replace for C
- Easy to use C/C++ IDE for Ubuntu Linux
- Get local ip in C on linux
An article by Binary Tides




