Skip to main content
Good afternoon. 

 

 

I need to pass in as a published parameter the WHERE clause to the ArcSDE Geodatabase reader.  I have created a published parameter named SQL and when creating the ArcSDE Geodatabase reader I attempt to use the parameter in this manner:

 

 

WHERE Clause: $(SQL)

 

 

However, attempting to do so causes the below error:

Undefined macro `SQL' dereferenced in file `C:\\DOCUME~1\\rolan002\\LOCALS~1\\Temp\\FME_1362421243497_6256'

Program Terminating

Is it possible in FME to use a published parameter with the ArcSDE Geodatabase reader?  Also, is it possible to pass in the SELECT and FROM clauses to the reader, too?  (I would need to do this because my statements are coming from a web page and are highly dynamic; if I can't do this, I could live with just passing in the WHERE clause and having a slew of workspaces to handle the possible user inputs from the form).

 

 

Thanks much.

 

 

Joe 

 

Hi,

 

 

FME should handle a parameter in the WHERE clause, did you connect the parameter to the reader's setting (wher clause)?

 

To try this you can create a parameter directly from the reader, by right clicking the where clause and creating a parameter.

 

The feature types to read can also be set into a parameter, that should take care of the FROM part of the statement.

 

Hope this helps.
Thanks, Itay.

 

 

Where on the reader is the option to right-click the WHERE clause?  On the reader, I see only the selected user attributes.  Is the WHERE clause for the reader accessible in the navigator, perhaps?

 

 

Thanks much.

 

 

Joe
Hi Joe!

 

 

There are two Geodb READERS. One FileGDB which is "free" with the Professional edition and one Geodatabase_file which uses ArcObjects. 

 

 

The free one does not have a WHERE option, but if you have an ArcSDE-lisence you can use the other READER (ArcObjects) and you have a WHERE option. For more information search for 'gdb' on http://www.safe.com/fme/format-search/

 

 

 


Thanks, Sig.  It appears we do have the full version (ArcObjects is available to me in the FME Workbench).  I will ask around in our office how to go about setting up the connection. 

 

 

Thanks much!

 

 

Joe 
Ok Joe. Then you should have a similar option as on the MSSQL Reader:

 

 


For the SELECT/FROM part, if you are looking to determine which tables to read from then also under the reader parameters should be one called "Feature Types to Read". This will let the end user decide which tables to read. You can see it at the bottom of the screenshot below.

 

 

For the WHERE clause, not to complicate things further, but I'm guessing you may not want the end user to have to enter the entire clause. For example, you might have "myfield = 1234" but you just want the user to enter the 1234 part.

 

 

For this, create a new parameter (right-click on the User Parameters option in the Navigator) and make it of type Integer or Text or whatever. For my example we'll call it ClauseValue. Now in the WHERE clause field enter:

 

 

myfield = $(ClauseValue)

 

 

...that way the user only has to enter the value and not the full clause.

 

 

Hope this is of use.
Thanks, Mark.  The users of the application will only make selections on the form, and then a Java servlet will create the SQL and send it to FME.  I very much appreciate your response. 

 

 

Joe

Reply