Ask Your Question
1

During the design of a table, how may I change the field's position?

asked 2012-08-13 12:20:38 +0100

this post is marked as community wiki

This post is a wiki. Anyone with karma >75 is welcome to improve it.

Hello I am having a little problem... and I don't know very well how to solve it. Let's imagine I am in the design View and I have a table with the following fields NAME LASTNAME ADDRESS CITY COUNTRY PHONENUMBER

ok... that is my table and I am in the design view...

Now I realize I want to add an additional field AGE... ok... I add AGE and what I have is this...

NAME LASTNAME ADDRESS CITY COUNTRY PHONENUMBER AGE

cool... but when I open the table I see age is at the end... and I would like to put it in the 3rd possition, because it's more logic to add the name, last name and then age, so instead having the ADDRESS field int he 3rd possition... I would like to move AGE from the very end... some possitions up...

How may I do this? I try to drag and drop it... but doesn't work I try to cut it and past it, but yes, I can cut it but doesn't allow me to paste it? so how may I do a simple thing like this, just moving the field some possitions up, how may I do this?

In access it's as easy as drag and drop... but in LibreOffice I try to do this and it's impossible...

edit retag flag offensive close merge delete

5 Answers

Sort by » oldest newest most voted
1

answered 2012-08-15 22:21:43 +0100

this post is marked as community wiki

This post is a wiki. Anyone with karma >75 is welcome to improve it.

Have you explored creation of a "view"? This should do what you want.

In the left side under Database, select Tables - in the Tasks pane select Create View...

I haven't really used or experimented with Views but a View seems to be very much the same as a query.

edit flag offensive delete link more

Comments

See the "Hey, good question..." answer here below, because I think that although this provides a workaround, it does not really answer the original question, and the other answer does answer it.

EasyTrieve gravatar imageEasyTrieve ( 2016-12-29 09:06:24 +0100 )edit
1

answered 2012-08-19 14:29:16 +0100

this post is marked as community wiki

This post is a wiki. Anyone with karma >75 is welcome to improve it.

Hey, good question, and I fully understand why you would want to arrange the table like you want it instead of using a view, query, or form to see it in a different arrangement. Here is the solution I found: In the window where you see the name of your table, right click on it, and choose copy. Then right click again in an open area near the name, and choose paste. Choose a new name, which can be changed later, and click next. A window will come up with all the fields listed. Select them one at a time and use the > to add them to the new table, in the order you want. Check each field to be sure it is the format you want and then create. The fields will be in the order you want. Rename the old table to something else and rename the new one to the name you want to use. Save the old one as a backup. OK? Good question.

edit flag offensive delete link more

Comments

Thanks a bunch!

EasyTrieve gravatar imageEasyTrieve ( 2016-12-29 09:03:16 +0100 )edit
0

answered 2018-12-05 21:47:52 +0100

knala gravatar image

updated 2018-12-05 21:49:27 +0100

This worked for me....

Create a view with the columns in the desired order and save it. In the main window on the new view, right select "copy". Again in the main window right select "Paste Special" and select "Data Source Table". Follow through to create the table. Delete any references to the old table, then delete the old table, rename your new reordered table and re-establish all the deleted links.

edit flag offensive delete link more
0

answered 2012-08-16 01:54:18 +0100

this post is marked as community wiki

This post is a wiki. Anyone with karma >75 is welcome to improve it.

Adding a column in the middle of a table with the embedded database is possible, but tricky (at least with LibreOffice 3.6.0.4). The embedded database uses HSQLDB version 1.8. The relevant command is here link text.

You need to use the SQL tool (Tools/SQL). Type in your command, e.g. ALTER TABLE YOURTABLE ADD COLUMN AGE INTEGER BEFORE ADDRESS; and execute. Immediately either refresh tables (View/Refresh Tables) or close LibreOffice and reopen it. If I did not do either of these steps then LibreOffice crashed and the column was not added (on Windows 7).

However I agree with JohnD. You can use a view or firm to arrange the columns as you wish. A form also lets you set field widths.

edit flag offensive delete link more
0

answered 2015-07-30 09:16:17 +0100

robertw gravatar image

Another simple solution is left click on the table select edit field list appears go to the last one hi-lite it click select cut move down to the empty row below click and paste data. You now have an empty row click cut and paste until you have the empty position you want for the new field. Works for small number of fields. For large tables use solution above.

edit flag offensive delete link more

Comments

1

This doesn't work for me. When you paste it jumps up to the place it was in before. It doesn't like blank fields. The solution is to put any character in the field name before pasting below it.

peterwt gravatar imagepeterwt ( 2015-07-30 12:43:13 +0100 )edit
Login/Signup to Answer

Question Tools

Stats

Asked: 2012-08-13 12:20:38 +0100

Seen: 6,704 times

Last updated: Dec 05