Skip to main content
Released

Order of columns/attributes set in SQL is ignored by FME

Related products:FME Form
  • February 3, 2016
  • 10 replies
  • 41 views

Forum|alt.badge.img

From SQL Executor, when Attributes are exposed and passed by FME they are automatically Alphabetized and the column/attribute order set is lost

In the case where SQL is used, Columns/Attributes should remain in the order they were set in the SQL statement

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.

10 replies

moberdries
Contributor
Forum|alt.badge.img+7
  • Contributor
  • June 13, 2018

SQLExecutor and SQLCreator


andreaatsafe
Safer
Forum|alt.badge.img+15
  • Safer
  • September 11, 2018
This idea is tracked internally with issue FMEENGINE-8759

 

 


Forum|alt.badge.img
  • November 29, 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".

I would like to have them in the original order.


joshuadamron
Contributor
Forum|alt.badge.img+8
  • Contributor
  • January 31, 2019

Adding the option to import attributes as a presorted list from excel would be a positive stop gap


Forum|alt.badge.img

Any progress on this issue (FMEENGINE-8759)? I'm writing out tables with 70+ fields and having to reorder the results is getting old.


  • October 7, 2020

I'm not convinced this should require a vote for popularity. I've never come across a product where you stick in a SQL statement and it outputs the results in alphabetical order.

I'd really class it as a bug.

I processed a 480 column table yesterday. No way would I touch FME for it. It would be impossible or so hugely irritating I'd throw my laptop out of the window :-)


  • December 15, 2020

I've been encountering this same issue and I'm convinced it's a bug.

 

I tried to work around this using a PythonCaller; I wrote a script that had a list of columns in the order I wanted, iterated through the feature and stored the column names from the list and their values in a dictionary, removed ALL the columns (so we're starting with a blank slate theoretically), iterated through the list I created and looked up the value for the column in the dictionary, then used feature.setFeature to add the attribute/value back into the feature. I would think this would now reflect the order of the columns as defined in the list, but it didn't. Features appeared in a random order (the same every time). I moved around the items in my list and got the same (wrong) order every time.

 

It seems FME decides what order columns should appear in based on something and doesn't let you change them.


Forum|alt.badge.img+1
  • May 11, 2021

Another vote for 'please fix'. I'm presently having to go through 61 attributes in an Attribute Manager to fix the order...


jennaatsafe
Safer
Forum|alt.badge.img+4

We're working on this now! When it's done, the status of this idea will be changed to Released, and we'll post a comment for which Beta you can find it in.


Forum|alt.badge.img
  • May 15, 2021

This will be a great enhancement. Note as a work around I paste in a list of comma separated attributes (in the desired order) into ”Attributes to Expose” , which the SQL transformers honour.