1. Tim Crouse
  2. Valentina Studio
  3. Sonntag, Oktober 29 2017, 08:11 PM
  4.  Abonnieren via E-Mail
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
Kommentar
There are no comments made yet.
Sergey Pashkov Akzeptierte Antwort
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.
Kommentar
There are no comments made yet.
  • Seite :
  • 1


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

Categories

Announcements & News
  1. 0 subcategories
Valentina Studio
  1. 2 subcategories
Valentina Server
  1. 4 subcategories
Valentina Database ADK
  1. 0 subcategories
Valentina Reports ADK
  1. 0 subcategories
Other Discussions
  1. 0 subcategories
BETA Testing
  1. 0 subcategories
Education & Research
  1. 0 subcategories
Omegabundle
  1. 0 subcategories