Question

Dynamic writer does not find existing schema

  • 17 September 2021
  • 5 replies
  • 35 views

Badge

I am writing to MSSQL using a dynamic featureWriter. But I can not understand why it fail to write to an existing schema.

 

Warning: Cannot find a matching schema named 'dbo.MyTable' in the known set of schemas: ''. Known schema sources are: 'MSSQL_SPATIAL_1'. Please verify writer feature type configuration

 

Error: Microsoft SQL Server Spatial Writer: A feature has arrived with 'fme_feature_type' of dbo.MyTable, but the feature type is not recognized. Halting translation

MSSQL_SPATIAL writer: A fatal error has occurred. Check the logfile above for details.

 

The fme_feature_type here is "MyTable". In the writer I use dbo as table Qualifier to match the existing table in my database "dbo.MyTable".

2021-09-17 14_27_50-FeatureWriter ParametersWhat is it I am not getting?

I have set the Schema Definition Name to the default option because it should use the table definition for the fme_feature_type "dbo.MyTable".

I will try to prefix the Schema Definition Name with the dbo. prefix but I just assume that should not be needed beause we have already defined a Table Qaulifier?


5 replies

Badge +3

If you rename fme_feature_type in schema feature. Then force the same name to all features. You can expose / create attribute fme_feature_type and set same name. Also set same name to fme_feature_type_name

Badge

I am not sure I follow.

In my example the fme_feature_type is expoesed as "myRecord". The destination table is also called "myRecord. The target database has a Table Qualifier dbo as defined in the writer.

I cannot find any documentation about the param fme_feature_type_name, what is that?

 

Badge +6

I am not sure I follow.

In my example the fme_feature_type is expoesed as "myRecord". The destination table is also called "myRecord. The target database has a Table Qualifier dbo as defined in the writer.

I cannot find any documentation about the param fme_feature_type_name, what is that?

 

Hi @so_much_more​, What version of FME are you working with? Also, have you checked out this tutorial that works with schemas derived from a schema feature (which seems to be your case if I've read correctly). Here is a full landing page for other tutorials on Dynamic Workflows as well. Hope this helps!

Badge

Hi @jennaatsafe​ thanks for your reply, I am using 2021.0.1.0.

I dont think I am using schema feature, I am trying to pick up the schema definition from the regular feature writer that I have set up as dynamic. I was on the phone with our Enterprice level FME distributors for 1.5hour trying out different things, but he could also not make sense why it would not work. We tried together most of the things I have already tried, so I call it a lost cause. Somewhere there is something FME cannot handle. I have had to roll back using the more mauall way of importing the table definition from the database instead for each feature type I am working with (multiple).

Badge +10

Hi @so_much_more​ , as I understand, to get this working, the name of the schema that has been read from the schema source (in your case, the MSSQL database), including the schema qualifier, should be exactly the same as the feature type specified in fme_feature_type. So I guess, if you read your schemas from dbo.MyTable, the feature that should write to that table should carry the attribute fme_feature_type with value 'dbo.MyTable'. So empty the Table Qualifier field in the feature type definition, and be sure to prefix your features fme_feature_type with 'dbo.' There is no way to remove the schema qualifier from FME schema definitions read using (resource) database readers. However, one could use a FeatureReader to get the schema information (including the table qualifier), and remove the table qualifier using a StringReplacer or so. Be sure to feed your writer with the schema record prior to feeding any data records in it. Hope this helps.

Reply