Skip to main content
Best Answer

How do I use a parameter to call a feature class in a Feature Reader when I run a workbench from a python script?

  • February 7, 2019
  • 4 replies
  • 83 views

surbhi
Contributor
Forum|alt.badge.img+2

I am trying to read metadata in FGDC format from a feature class using a python script and workspace runner to call in a workbench. I want to know how I can set a parameter to call a feature class from a geodatabase.

Best answer by markatsafe

You should be able to use the reader parameter called Feature Types to Read. It's available on all readers and in the FeatureReader

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

4 replies

Forum|alt.badge.img+2
  • Best Answer
  • February 8, 2019

You should be able to use the reader parameter called Feature Types to Read. It's available on all readers and in the FeatureReader


surbhi
Contributor
Forum|alt.badge.img+2
  • Author
  • Contributor
  • February 8, 2019

thanks @MarkAtSafe !

that worked for me when I read a feature class from a file geodatabase.

 

However when I try to do read a feature class from a SDE geodatabase, I get an error which starts with 'Too many recursive macro substitions -- line currently is: `SOURCE_READER GEODATABASE_SDE CONNECTION_FILE "$(CONNECTION_FILE)"

Do you know what may be causing this error?


Forum|alt.badge.img+2
  • February 11, 2019

thanks @MarkAtSafe !

that worked for me when I read a feature class from a file geodatabase.

 

However when I try to do read a feature class from a SDE geodatabase, I get an error which starts with 'Too many recursive macro substitions -- line currently is: `SOURCE_READER GEODATABASE_SDE CONNECTION_FILE "$(CONNECTION_FILE)"

Do you know what may be causing this error?

@surbhi It looks like you've created a parameter and are using that parameter to set the SDE connection file parameter that already exists. I might try disabling your existing Geodb SDE reader in the navigator and then adding a new Geodb SDE reader from scratch and see if that fixes your workspace


germang
Contributor
Forum|alt.badge.img+13
  • Contributor
  • March 24, 2022

thanks @MarkAtSafe !

that worked for me when I read a feature class from a file geodatabase.

 

However when I try to do read a feature class from a SDE geodatabase, I get an error which starts with 'Too many recursive macro substitions -- line currently is: `SOURCE_READER GEODATABASE_SDE CONNECTION_FILE "$(CONNECTION_FILE)"

Do you know what may be causing this error?

Hi @surbhi, you can try to use a ParameterFetcher to fetch the connection file and pass that parameter as an attribute instead of as a publish parameter in the FeatureReader.