Skip to main content
Solved

Attribute Exposure in SQL Executer

  • February 23, 2024
  • 2 replies
  • 87 views

harish
Contributor
Forum|alt.badge.img+10

I am using SQL Executer but in the output port I am not getting the attribute exposed automatically. My SQL expression I am only counting the inputs so I cannot expose the attribute using “Populate Attribute from SQL”. I cannot use Attribute exposer every time I am using the SQL. Is there any other way to do this.

Best answer by david_r

Depending on the database it might be a good idea to set a column alias when using functions, e.g.

select count(*) as "MY_COUNT"
from my_schema.my_table
where my_criteria

In this case you should expose MY_COUNT in the SQLExecutor.

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.

2 replies

virtualcitymatt
Celebrity
Forum|alt.badge.img+47

For me doing a count(*) works in PostGIS - I get ‘count’ exposed in FME 2023 (when using the Populate from SQL Query function).

FME will make the call in order to figure out what needs to be exposed. If you have attribute values in the call then the query wont work. The call in the SQL Query to Populate Attributes window should be valid.


 


david_r
Celebrity
  • Best Answer
  • February 23, 2024

Depending on the database it might be a good idea to set a column alias when using functions, e.g.

select count(*) as "MY_COUNT"
from my_schema.my_table
where my_criteria

In this case you should expose MY_COUNT in the SQLExecutor.