Solved

How to use a parameter to get a table from an SDE connection.


Badge +1

Our team are trying to create a workbench which will be used to answer user data requests. The workbench should provide a packaged export from our Oracle database, including a schema definition, metadata and various file type(s).

 

I'm trying to make this as simple as possible by using parameters for the user to input, including table name and spit out folder at the end however I'm stuck when trying to create a parameter for the table name we want to download using the Esri Geodatabase (ArcSDE Geodb) Reader.

 

I've actually managed to work around this for the metadata by setting a default table, using the merge feature type option and using a wildcard, then setting a parameter from that. However when I try this with features although I get the geometry I get an empty attribute table.

 

Anyone have any experience of this or potential better solutions?

icon

Best answer by markatsafe 6 July 2022, 19:09

View original

4 replies

Badge +2

@jaymiecroucher​ Under the reader parameters in the Navigator, there is a node Feature to Read and under that the parameter Feature Types to Read. If you publish that, then FME will prompt the user for the Feature Class or table name.

Badge +1

@jaymiecroucher​ Under the reader parameters in the Navigator, there is a node Feature to Read and under that the parameter Feature Types to Read. If you publish that, then FME will prompt the user for the Feature Class or table name.

Thanks for the quick response @Mark Stoakes​! I've input the published parameter however I still get the following issues:

 

  1. If I read in all tables within the SDE connection I get a giant schema (4K+ Attributes) as an output. The fields relevant to the user inputted table are populated however due to the size I can't drop the fields with missing values. Ideally this would work fine however I just cant drop fields with missing value for this size of output. I've attempted using the NullAttributeMapper and it just spits nothing out. Picture attached for example.
  2. If I read in just one table as a default and then set the parameter I get the correct geometry on the user defined table but the schema matches the feature I selected when bringing in the reader initially.

 

Any idea on potential workarounds?

Badge +2

@jaymiecroucher​ It is a little messy when you first configure the Single Merged Feature Type. For the data reader, on the <All> feature type, edit the user attributes and remove all the attributes. These are lingering from the feature class you used to create the reader.

In the Navigator, right click on Parameters and open the Manage User Parameters (FME 2021 and up) and check the Feature Types to Read parameter - in your case Input the full dataset you require. Check the Default Value. This is GIS_ADMIN.Bus_Lanes - probably the feature class you used to create the reader. If you run the workspace and select another feature class, it will get added to the list - so you'll get GIS_ADMIN.Bus_Lanes + what you selected. Set the Default Value to <blank> to avoid this.

I think that should fix it.

Badge +1

Thankyou. This did work in a fashion however the size of the schema, which was a necessary step initially, made the workbench break down. A colleague actually helped me identify the FeatureReader transformer instead and creating a parameter from that instead of using a Reader directly. This made it far easier to select prior to running.

 

Thankyou @Mark Stoakes​ , I will mark your solution as the answer as it would work outside of the complexities of how we host data!

Reply