Subject Re: [firebird-support] table prettifier
Author Ann W. Harrison
Nick Upson wrote:
> has anyone written something like this? I'm getting complaints that
> each time I deliver a new version of the system I'm working on
> (ongoing development) the column names are in a different order due to
> modification which makes them more difficult to browse.
>
> Ideally what I had in mind was to always sort the fields so that the
> Pkey was first, then secondary keys (in alphabetic order), then all
> others (alphabetic order).
> But any way to return the fields to a predictable order would be sufficient.
>

Alter table t1 alter column pk_c1 set position 1;
Alter table t1 alter column pk_c2 set position 2;
Alter table t1 alter column pk_c3 set position 3;
Alter table t1 alter column fk_c1 set position 4;

etc...

Regards,

Ann

Yes, you'd have to write a slightly complicated procedure
to find and order the fields correctly if you've got a multi-
level ordering, but it's certainly possible.


Regards,


Ann