Ask Your Question
1

How do I change the order of fields when I edit a table? base 5.0.3.2

asked 2015-11-18 04:15:31 +0200

dlnewhouse gravatar image

updated 2016-03-14 00:21:32 +0200

Alex Kemp gravatar image

I am trying to move a field from the end of my table to somewhere in the middle. How do I do this?

edit retag flag offensive close merge delete

Comments

I used to be able to do this after clicking Edit on the table's context menu. Then I would cut and paste the field I wanted to move to first place. And then the one I wanted in second place. And so forth. Then I'd save the table. Exit the edit window. And save the file.

Now when I do that, the changes do not take effect.

I have no idea why. It's weird and it's frustrating.

(And, no, I haven't changed any settings or upgraded the software. I'm using LO 6.0.6.2 on Win7.)

markroth gravatar imagemarkroth ( 2018-09-11 21:14:23 +0200 )edit

2 Answers

Sort by » oldest newest most voted
0

answered 2019-02-15 23:11:41 +0200

lucky67 gravatar image

I came across this (old) question trying to do the same thing. Not as professional but I found a work around that I found easier than using SQL. (Although I guess I should look at MySQL Workbench....)
Probably easier/safer If you haven't got lots of data in your table and I would make sure I had a backup first and know the 'field type' /settings of each field.

I 'imported' (dragged the table into) a blank calc sheet. Added a new column and the new field name I wanted. Deleted the table in Base, went back to Calc and exported (dragged back) the table to Base. Gave it the same name, used the column headings as field names etc. I did have to go through and reset the field type of each field. I might have to edit a couple of queries and a form.... but quicker than having to make a new table, typing in 15 field names etc.

I guess I should say that I had no data in the table - I was using a copy of a pre-existing database as a template and needed to add and change a couple of field names in one table. And also I import and export tables between Base and Calc quite often - I get data sent to me as an Excel file (don't have a choice about it) that I want to add to a database.

edit flag offensive delete link more
1

answered 2016-03-15 23:41:13 +0200

Ratslinger gravatar image

SQL. I don't know of a way to do this within Base easily. I typically use SQL Workbench or MySQL Workbench depending on what database I'm using. If the DB is empty, it is fairly simple. Take the SQL source displayed, re-arrange (cut & paste) what you want, Drop the old & create the new. If, however, you have data in the DB, it can be tedious. Create a new table with what you want then with SQL, copy the data from one table to another field by field. As a side note, there is no logical reason that fields have any sequence within a database.

edit flag offensive delete link more

Comments

Confirmed on LO 5.1.0.3, you can try to drag-drop the columns but the cursor changed to the You can't do this one, and doesn't matter how you drag or drop. However, I checked the HSQLDB 1.8.0 syntax and it confirms you can change the order through SQL: http://www.hsqldb.org/doc/guide/ch09.html#alter_table-section. Although I can understand the reason for lack of such feature to be harder to figure out which column was moved where, it's not impossible, just keep copies of the column names.

rautamiekka gravatar imagerautamiekka ( 2016-03-16 00:07:57 +0200 )edit

I also want to note that it is as easy as drag & drop to move columns using MySQL Workbench.

Ratslinger gravatar imageRatslinger ( 2016-03-16 13:00:54 +0200 )edit
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2015-11-18 04:15:31 +0200

Seen: 1,463 times

Last updated: Feb 15