1. Tim Crouse
  2. Valentina Studio
  3. Sunday, October 29 2017, 08:11 PM
  4.  Subscribe via email
Do you have to create the fields in the filed design table in the order you want them to appear or can the field position tag be change to get the table to re-order the fields.

If you cannot re-arrange the fields would it be better to create the fields in a CSV file and import them into a table?

I am trying to come up with a way to handle re-arranging filed order at design time as needed change in the order are realized.

Thanks
Tim
Comment
There are no comments made yet.
Sergey Pashkov Accepted Answer
Hello Tim,

Where exactly do you want to change the field position?

If only for viewing In the Data Editor - there is the Layouts feature of the Pro version, it allows the user to reorder(or hide) fields and save this order, so it will be used the next time for this table.

If you need to reorder physically then it is easier to use the SQL commands for it.


-- Table with wrong fields order
CREATE TABLE t1(
f2 TEXT,
f1 INT );

INSERT INTO t1 VALUES( 'abc', 1 );

-- Table with correct fields order
CREATE TABLE temp_t1(
f1 INT,
f2 TEXT );

INSERT INTO temp_t1( f1, f2 )
SELECT f1, f2 FROM t1;

DROP table t1;

ALTER TABLE temp_t1 RENAME TO t1;


But if there are triggers, foreign keys, etc the query should include statements to recreate/drop these objects as well.
Comment
There are no comments made yet.
  1. more than a month ago
  2. Valentina Studio
  3. # 1
  • Page :
  • 1


There are no replies made for this post yet.
However, you are not allowed to reply to this post.