Skip to main content
Solved

Dynamic SQLExecutor to dyamic FeatureWriter (CSV)

  • March 7, 2024
  • 6 replies
  • 104 views

david_
Contributor
Forum|alt.badge.img+8

Hi,

I have a SQLExecutor with a dynamic SQL Server query like:

SELECT * FROM value(@table_name)

Obviously, as it is a dynamic query I don't expose any attribute.

Then, I connect the schema and generic outputs to a featureWriter (CSV).

When I run the workspace, It finish suscessfully but It doesn't generate the CSV file.

The same problem if I try to generate the CSV file with a dynamic writer instead of a featurWriter.

However, if I replace the SQL Executor with a dynamic featureReader, the CSV is generate correctly.

I need a SQL Executor because the query will be a bit more complex.

I think It is something related with schema but I missing something.

Could anyone help? Thank you un advance!

 

Regards.

 

Best answer by nielsgerrits

The FeatureReader has a SchemaFeature as output where the SQLExcecutor has not.

The SchemaScanner creates a SchemaFeature from data features.

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.

6 replies

nielsgerrits
VIP
Forum|alt.badge.img+62
  • Best Answer
  • March 8, 2024

The FeatureReader has a SchemaFeature as output where the SQLExcecutor has not.

The SchemaScanner creates a SchemaFeature from data features.


david_
Contributor
Forum|alt.badge.img+8
  • Author
  • Contributor
  • March 8, 2024

Hi @nielsgerrits.

first of all, thank you very much for your help.

I also tried to use the schemaScanner but with no results.

In the following capture, on the left side is the workflow, and on the rigth side the configuration of the schemaScanner and featureWriter.

 

The following ones are the Visual preview for the features (48) and the schema (1)

 

Am I missing something?

Thank you!

 

Regards.


nielsgerrits
VIP
Forum|alt.badge.img+62

This is how I would configure it, and I expect it to work.

Any warnings / errors in the log?

What version FME do you use?

Is FME allowed to write on this location?


david_
Contributor
Forum|alt.badge.img+8
  • Author
  • Contributor
  • March 8, 2024

I have found the issue. It was in the configuration of the dynamic featureWriter.

I should have set up the “Schema Definition Name” as [fme_feature_type_name] instead “Default from CSV File name above”

 

 


david_
Contributor
Forum|alt.badge.img+8
  • Author
  • Contributor
  • March 8, 2024

Many thanks @nielsgerrits!

I really appreciate your help.

Regards.


nielsgerrits
VIP
Forum|alt.badge.img+62

Many thanks @nielsgerrits!

I really appreciate your help.

Regards.

Cheers!