Skip to main content

Hi All, First of all, thank you for taking your time to read this post.

FME Desktop 2022.2

Objective: Using the Feature Reader I’m trying to dynamically have a user input an existing sde table name (so the user is prompted to insert the table name that already exists), then I have a reprojector followed by the FeatureWriter to Drop and Create the table in a new projection. The table to be dropped an create will be the same one inserted by the user. Hence, this table already exists. 

Error: ‘Feature Type Definition {feature here} was requested, but not defined’. I checked another similar post, but I still can’t get my workbench to work. 

 

I have a Feature Reader set as follows:

 

When I run the workbench, the FeatureReader does not show the table name that was inserted by the user, but instead, it catches the table records under ‘Generic’ see screenshot below.  (If I were to access that table statically (connecting to the table via the SDE connection), then the table name will display along with it’s schema definitions columns and attributes).

When I inspect it, it shows like this below. Notice there no schema displayed such as the column name and its attributes, however, it does pick up the geometry points.  

 

Feature Writer: Notice I have fme_feature_type as the feature class. This contains the value of the table that the user entered. 

 

Under User Attributes tab I have the attribute definition set to Dynamic, but it does not show the columns field names.

 

When I run it, the workbench fails and I get the error:

Feature Type Definition {feature here} was requested, but not defined

 

I’ve also tried the $(TableName) parameter on the FeatureWriter feature class but still get the same error.

 

However, If I set the attribute definition to Automatic, then the Feature Writer Parameters automatically change 

 

Notice how the Geometry is automatically changed to geodb_point and the dynamic schema definition is disabled :

When I run this, it runs successfully, the table is dropped and created with the new projection but it is missing the schema (column field names and its attributes). 

 

Question: What else can I do to get this working? I don’t want to create Staging table then having to go back and rename tables etc.

Thank you. 

You also need the schema feature from the featurereaders schema outputport and put that in the same featurewriters inputport where the data features go, and you need to be sure it arrives at the featurewriter before the datafeatures.

The attributes are there, but as the table is selected at runtime, workflow will not know what they are beforehand and thus the attributes are unexposed. In the preview, select a feature and check the feature information window.

To get the order right, I use attributecreators in the schema and datastreams which creates an attribute with name order and values 1 and 2, followed by a sorter to make sure the schema feature is the first row to arrive at the featurewriter.


Thank you for your explanation @nielsgerrits . I have introduced a counter to the Reader’s Schema port and another counter to the Reader’s Generic followed by a sorter like you suggested. It worked smoothly. Thank you. 


Reply