Skip to main content
Solved

Dynamic SQLExecutor to dyamic FeatureWriter (CSV)


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.

View original
Did this help you find an answer to your question?

6 replies

nielsgerrits
VIP
  • 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

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
david_ wrote:

Many thanks @nielsgerrits!

I really appreciate your help.

Regards.

Cheers!


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings