Skip to main content
Question

writing schema to SQLite

  • November 2, 2018
  • 2 replies
  • 72 views

gpt_geoinfo
Contributor
Forum|alt.badge.img+2

Hey there,

I'm stuck! I need to export an Oracle database to a SQLite file. Even empty tables must be in the file.

 

I already tried to understand the suggestions in the articles "dynamic writer to write empty feature classes", "When data is missing, I want to output an empty feature class anyway" and "Copy only Schema to an other database", but none of these helped me. The stumbling block might be the fact that I never know which table with which schema is empty. The NoFeaturesTester might not help here.

This is what my workspace looks like so far:

To trigger the FeatureReader I read several XML-files to get a list of the desired tables (attribute "FeatureName"). This list is then used as the Reader's parameter "Feature Types to Read". With the output UnusedSuppliers I try to go to the writer directly or with adding a simple point.

These are the empty tables (from the output UnusedSuppliers)

The SQLite does not contain these empty tables, rather there is a table named "FeatureName" with 7 empty entries, which don't correspond to the schema.

I played a little with the Writer's parameter "Table Name" and "Schema Definition Name", with no effect.

 

Any suggestions?

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

david_r
Celebrity
  • 8394 replies
  • November 2, 2018

Just a quick tip, you don't need to use the FeatureMerger here, simply send the schema feature directly to the FeatureWriter input port. As long as you don't prevent the schema feature from entering before the data features, all should be ok.


takashi
Celebrity
  • 7843 replies
  • November 2, 2018

Hi @gpt_executer, If you intend to create and write a single feature to each destination table which was empty in the source database, probably it's necessary to add at least one user attribute storing a value to the feature.

In addition, every schema feature has "fme_schema_handling" attribute that stores "schema_only". If the first feature for a feature type has the "fme_schema_handling" attribute, the dynamic writer consider it as a schema feature and would not write it into the destination feature type. I think you have to remove the attribute before merging schema features to data features.

Hope this workflow works as expected.