Skip to main content
Solved

SQLExecutor - Keep order when populating the attribute list for the query

  • June 27, 2017
  • 12 replies
  • 45 views

Is it possible to keep the order of the query fields when you get the attributes using 'Populate from SQL Query...'? I use it very often and the attributes are ordered alphabetically instead of the order in the query.

Thank you

Best answer by david_r

You'll have to order the attributes manually after importing them, unfortunately.

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

12 replies

jneujens
Forum|alt.badge.img
  • 189 replies
  • June 27, 2017

Isn't it possible to set the order of the attributes in the 'attributes to expose' settings?


david_r
Celebrity
  • 8394 replies
  • Best Answer
  • June 27, 2017

You'll have to order the attributes manually after importing them, unfortunately.


ebygomm
Influencer
Forum|alt.badge.img+44
  • Influencer
  • 3429 replies
  • June 27, 2017
If you suggest it as an idea, I'd vote for it

 

 


david_r
Celebrity
  • 8394 replies
  • June 27, 2017
If you suggest it as an idea, I'd vote for it

 

 

Agreed. I'd rather the database order was preserved and having an optional "sort" button.

  • Author
  • 3 replies
  • June 27, 2017

Isn't it possible to set the order of the attributes in the 'attributes to expose' settings?

No, it is not possible.

  • Author
  • 3 replies
  • June 27, 2017
If you suggest it as an idea, I'd vote for it

 

 

There was already a idea for that:

 

https://knowledge.safe.com/idea/22950/order-of-columnsattributes-set-in-sql-is-ignored-b.html

 

 


mark2atsafe
Safer
Forum|alt.badge.img+56
  • Safer
  • 2554 replies
  • June 27, 2017
If you suggest it as an idea, I'd vote for it

 

 

fwiw (they may not count it) I voted for this!

 

 


ebygomm
Influencer
Forum|alt.badge.img+44
  • Influencer
  • 3429 replies
  • June 27, 2017
fwiw (they may not count it) I voted for this!

 

 

It wouldn't let me vote for this so I'm guessing I already voted at some point

 

 


Forum|alt.badge.img

If you have DDL access create a view in your DB and import that.


Forum|alt.badge.img
  • 13 replies
  • November 28, 2018

I have the same problem in FME 2018. A large list of attributes generated from an SQL query is sorted alphabetically in "Attributes to expose".

Is the only solution still to sort them manually?


xiaomengatsafe
Safer
Forum|alt.badge.img+11
  • Safer
  • 324 replies
  • November 28, 2018

I have the same problem in FME 2018. A large list of attributes generated from an SQL query is sorted alphabetically in "Attributes to expose".

Is the only solution still to sort them manually?

Hi @stihe, Looking at the status of this related Idea, https://knowledge.safe.com/idea/22950/order-of-columnsattributes-set-in-sql-is-ignored-b.html, unfortunately I believe currently manually reordering them is still the only option. Please vote for the idea, and add your comment to give that idea more momentum. Thank you very much!


Forum|alt.badge.img
  • 8 replies
  • April 9, 2019

An other somewhat hacky option is to use other software, like toad, to extract the first record of your data to csv, then copy the header row and paste it into the attributes to expose.

While it takes a few steps if saves having reorder everything, especially when you have a lot of fields.

Note when you first add the transformer you can't manually edit the attributes, so just enter anything from the ... then you can paste in you list of fields on the main transformer screen.

Hope this helps