Select to view content in your preferred language

Inline Variable Substitution in SQL Expression Variable Using Model Parameter Value ArcGIS PRO

1015
2
10-07-2022 08:41 AM
Gene_Sipes
Frequent Contributor

I am trying to port over a model that I built in ArcMap, to Pro.

I am receiving a SQL error stating "fields do not match" when trying to set up a SQL Expression for use in the Select Layer By Attributes tool. The SQL Expression is connected to the Select by Attributes Tool, and attempts to use inline variable substitution to insert the model parameter value "SectorNumber" in the expression. The goal is to create a selection set of records from Centerline202.. that match Sector = %SectorNumber%.

Here is an overview of the model layout. 

Gene_Sipes_2-1665156766717.png

Here is a screenshot showing a valid SQL message when using a hardcoded value of 3. 

Gene_Sipes_1-1665156741114.png

When trying to add the "SectorNumber" model parameter as an inline variable in the SQl Expression I get:

Gene_Sipes_3-1665156942856.png

I have tried numerous versions of %SectorNumber%, "%SectorNumber%", (%SectorNumber%), and cannot get anything to work. 

The data is file based (FGDB)

 

 

 

2 Replies
britthartery
Emerging Contributor

I'm having the same problem. It worked when I made the fields text though, using just (for example) ID = %Value%

Gene_Sipes
Frequent Contributor

I never found a solution, and gave up a while back. Thanks for your input though!

0 Kudos