Skip to main content

Hello

Is there a way we could copy only the schema ( table name and related attribute ) no data into another database, SQL server, and Postgres, multiple table at once

Thanks

Hi,

I have not tested but try by passing one feature with feature writer and truncate the table after feature writer.

This just a workaround.

Pratap


yes it is , but some tables are empty from the source


It's possible, but a bit convoluted. FME isn't schema based, it's feature based. This means that if there's no feature arriving at the output feature type, then nothing happens: no table creation, truncates, etc.

As @pratap suggests, it's possible to work around this by creating and writing dummy features which you delete in the end, e.g. using a shutdown SQL script or a second workspace.


yes it is , but some tables are empty from the source

Have you tied Schema (Any Format) reader?
Have you tied Schema (Any Format) reader?
Unfortunately you cannot write schemas, only read them...

It's possible, but a bit convoluted. FME isn't schema based, it's feature based. This means that if there's no feature arriving at the output feature type, then nothing happens: no table creation, truncates, etc.

As @pratap suggests, it's possible to work around this by creating and writing dummy features which you delete in the end, e.g. using a shutdown SQL script or a second workspace.

@david_r

 

is ok for the table with features about the empty table how could add a fake feature if we cant read them, and we don't know those table in advance since we are reading Dynamic schema, and there is many tables there

 

 


Unfortunately you cannot write schemas, only read them...
Yes, but objective at this moment is to generate a feature and not writing :)

 


@david_r

 

is ok for the table with features about the empty table how could add a fake feature if we cant read them, and we don't know those table in advance since we are reading Dynamic schema, and there is many tables there

 

 

Have a look at the NoFeaturesTester from the FME Hub, it may be helpful here.

 

For reading the schemas, I would recommend using the FeatureReader, which will enable you to read both the schema and the features in one go (no need to use the separate schema reader).
Have a look at the NoFeaturesTester from the FME Hub, it may be helpful here.

 

For reading the schemas, I would recommend using the FeatureReader, which will enable you to read both the schema and the features in one go (no need to use the separate schema reader).
Yes this transformer will work for sure...

 

 


It's possible, but a bit convoluted. FME isn't schema based, it's feature based. This means that if there's no feature arriving at the output feature type, then nothing happens: no table creation, truncates, etc.

As @pratap suggests, it's possible to work around this by creating and writing dummy features which you delete in the end, e.g. using a shutdown SQL script or a second workspace.

if we use a dynamic reader to read multiple tables it will give you only table with feature and ignore the one without

 

the other option I tested is to use feature reader, but use the schema output then use list exploder to expose all the attributes not we are getting in one column the name of the table and the second one the name of the attribute , but how we could now pass that to the database in order to create the those table.

 

feature-reader-output.png

 

schema-extraction.png

 

 

 

 


if we use a dynamic reader to read multiple tables it will give you only table with feature and ignore the one without

 

the other option I tested is to use feature reader, but use the schema output then use list exploder to expose all the attributes not we are getting in one column the name of the table and the second one the name of the attribute , but how we could now pass that to the database in order to create the those table.

 

feature-reader-output.png

 

schema-extraction.png

 

 

 

 

It seems, you are using schema reader instead of reading empty table

 

 


Reply