Skip to main content
Question

writing schema to SQLite


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?

2 replies

david_r
Celebrity
  • 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
Influencer
  • 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.


Reply


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