Wildcard SQL syntax

1302
3
04-17-2011 02:58 PM
TimothyGoddard
New Contributor
I'm been through the forums and some SQL references and can't quite get this to work.  Not sure if it is my syntax or the structure of the data itself.

I want to allow users to search the address field of the parcels data set.  I want them to be able to enter a partial address and then the search do a wild card.

Here is my latest version.  If i search the entire value like in the example it returns the right record but not if i just type 46 or 46 CORNHILL or any sub variant.  I have tried the different wildcard symbols % and *  My data is just in a shapefile in the Arcmap document.

Any suggestions would be appreciated.  I have tried many variants but can't seem to get it quite right.  Thank you.

See below for the current definition in the esearch widget configuration.xml

     <layer>
            <enableexport>true</enableexport>
            <name>Parcels</name>
            <url>http://preservationsearchwebgis.anth.umd.edu:8399/arcgis/rest/services/AIA_Basic_Web/MapServer/11</url>
            <expressions>
                <expression alias="Parcel Address" textsearchlabel="Search by Address [ Example: 46 CORNHILL STREET]:">Upper(ADDRESS) like Upper('[value]*')</expression>
            </expressions>
            <graphicalsearchlabel>Use one of the graphical search tools to select Archaeology Reports</graphicalsearchlabel>
            <spatialsearchlayer>true</spatialsearchlayer>
            <titlefield>Parcels</titlefield>
            <fields all="true">
            </fields>
            <linkfield></linkfield>

Thank you .

Tim
Tags (2)
0 Kudos
3 Replies
philippschnetzer
Occasional Contributor III
I have such a query working....it looks identical to your syntax other than I use the wildcard % and my data resides in a FGDB.
0 Kudos
BjornSvensson
Esri Regular Contributor
The wild card is database dependent.  One way to test different SQL's is by going to the Service Directory and using the Query link at the bottom of your layer page. This will allow you to easily test different SQL and see the outputs.
For example:
http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/BloomfieldHillsMichigan/Parcels/MapServer...
or in your case
http://preservationsearchwebgis.anth.umd.edu:8399/arcgis/rest/services/AIA_Basic_Web/MapServer/11/qu...
0 Kudos
TimothyGoddard
New Contributor
Thank you everyone, i was finally able to get it to work.  The query function out of the rest services directory was a great help.

Tim
0 Kudos