Updated: File Layout SQL

My post yesterday was a little wrong. Here is a better SQL to help with the sequence of the fields in the layout:

SELECT * FROM (

  SELECT A.FLDFIELDNAME, A.FLDSTART,

        (SELECT COUNT(*) FROM PSFLDFIELDDEFN 

         WHERE FLDDEFNNAME = A.FLDDEFNNAME

         AND FLDSTART < A.FLDSTART) + 1 CORRECT_SEQ,

         A.FLDSEQNO ACTUAL_SEQ

  FROM PSFLDFIELDDEFN A

  WHERE A.FLDDEFNNAME = '<File Layout Name>'

)  B

WHERE B.CORRECT_SEQ <> B.ACTUAL_SEQ

ORDER BY B.FLDSTART

I had trouble rearranging the fields though. You can drag and drop the fields, but when you reopen the file layout, you find that it didn’t actually adjust the field sequence (FLDSEQNO). So, the fields are back in the order they were in. This is true for tools 8.46; I didn’t test 8.49.The only way I could find to rearrange the fields was to delete the field from the layout. Then, click on the field that you wanted it after and re-insert it.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: