Select to view content in your preferred language

Esearch - Error 1009

4607
29
Jump to solution
08-28-2012 07:18 AM
Scott_Russell
Regular Contributor
Hello,

I posted a question similar to this in the Flex API forum yesterday.  I am attempting to perform a SQL query for a TEXT field that is in our Valves feature class.  The field is an ID number field but also contains letters. I'd like the user to have the ability to type in a valve number and successfully select it.  Here is what I have so far:

<configuration>
    <layers>
        <layer>
            <definitionexpression/>
            <enableexport>true</enableexport>
            <name>Valves</name>
            <url>http://valhalla:6080/arcgis/rest/services/WebMap/MapServer/9</url>
            <expressions>
                <expression alias="Valve ID Search" textsearchlabel="Search Valve ID:">
                    <values>
                        <value prompt="Example:100">FACILITYID = '[value]'</value>
                    </values>
                </expression>
            </expressions>
            <graphicalsearchlabel>Use one of the graphical search tools to select Valves</graphicalsearchlabel>
            <spatialsearchlayer>true</spatialsearchlayer>
            <titlefield>FACILITYID</titlefield>
            <fields all="true"/>
            <links/>
            <zoomscale usegeometry="true" zoompercent="2"/>
        </layer>

Keep in mind that although this is a field used for IDs and most values are numeric, the field is a TEXT field which contains letters in some cases.

When I attempt to perform the above action I receive Error #1009.  What am I doing wrong?  I have confirmed that FACILITYID is the field alias within the table.  I determined the URL by clicking on the Valves layer link in the REST services URL in ArcGIS Server.

Thanks,
Scott

EDIT: I'd like to point out that FACILITID = '[value]' yields results in the default Search widget in the Flex Viewer.
Tags (2)
0 Kudos
29 Replies
Scott_Russell
Regular Contributor
I do not.  I attached a small screenshot of the attribute table and FACILITYID field properties from that MXD in case it is useful.

Thanks,
Scott
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Scott,

   I am running out of ideas here, but lets try one more thing.

Paste this in your browsers addressbar and then copy all the results to a text file and attach it for me to review.

http://valhalla:6080/arcgis/rest/services/WebMap/MapServer/9?f=pjson
0 Kudos
RhettZufelt
MVP Notable Contributor
What happens if you try this?

<value prompt="Example:100">UPPER(FACILITYID) LIKE UPPER('%[value]%')</value>


I know this isn't what you are after, but if this gets results, there are some hidden spaces/characters in your attributes.

I've had issues like that before, then a LTrim(),RTrim() on the attribute column fixed it up.

Just a thought,

R_
0 Kudos
Scott_Russell
Regular Contributor
Thank you very much for all of the time you're spending to help me.  It is very appreciated.

I attached the .txt file for you.

Thanks,
Scott
0 Kudos
Scott_Russell
Regular Contributor
What happens if you try this?

<value prompt="Example:100">UPPER(FACILITYID) LIKE UPPER('%[value]%')</value>


I know this isn't what you are after, but if this gets results, there are some hidden spaces/characters in your attributes.

I've had issues like that before, then a LTrim(),RTrim() on the attribute column fixed it up.

Just a thought,

R_


Strangely enough, this yielded error 1009 again.  Thanks for the insight!!
0 Kudos
RhettZufelt
MVP Notable Contributor
What is the base data format?  FGBD, PGDB, shapefile?

Also, have you tried making a new field and calculating it from the FACILITYID field and tried the search on that?
 [NEWFIELD] = Ltrim(Rtrim(FACILITYID))

<value prompt="Example:100">NEWFIELD = '[value]'</value>


In the past I have resolved some issues this way.  Never found the problem, but "fixed" it.

R_
0 Kudos
Scott_Russell
Regular Contributor
What is the base data format?  FGBD, PGDB, shapefile?

Also, have you tried making a new field and calculating it from the FACILITYID field and tried the search on that?
 [NEWFIELD] = Ltrim(Rtrim(FACILITYID))

<value prompt="Example:100">NEWFIELD = '[value]'</value>


In the past I have resolved some issues this way.  Never found the problem, but "fixed" it.

R_


It is a feature class within a SQL Server Geodatabase.  I'll have to wait for after-hours some day to do this, hopefully tomorrow.  Thank you, I will give it a shot.

I'm theorizing that something in my code is wrong.  The query works great in the Search tool that comes with the Flex Viewer Builder, but failing in the eSearch.  I'm flabbergasted.
0 Kudos
CoryHines
Deactivated User
Hi guys,

I too have run into this, but only at flex viewer 3.  I have 2 identical queries, one at 2.2 and one at 3.  The http requests are slightly different, but essentially the same, yet 2.2 returns a result, but 3 doesn't.  It only seems to be an issue on the subdivision search.  here are the 2 query specs and the sites you can test.  for 2.2 = http://gis.linncounty.org/maps for 3 http://gis.linncounty.org/fv3

I also tried running the query against the TOWN field and get the same error, but I can't see anything that is wrong with the layer.  Both sites are hitting the same service.

fv 2.2
<layer>
  <name>Subdivisions</name>
            <url>http://gis.linncounty.org/arcgis/rest/services/LandRecords/MapServer/18</url>
            <expressions>
             <expression alias="Name" textsearchlabel="Search by Subdivision Name">SUBDIVISIONNAME LIKE '[value]%'</expression>
            </expressions>
            <graphicalsearchlabel>Use one of the graphical search tools to select Subdivisions</graphicalsearchlabel>
   <spatialsearchlayer>true</spatialsearchlayer>
   <titlefield>SUBDIVISIONNAME</titlefield>
            <linkfield></linkfield>
   <icon isfield="true" iconprefix="" iconsuffix=""></icon>
   <zoomscale>4800</zoomscale>
            <fields all="false">
                <field name="SUBDIVISIONNAME" alias="Name"/>
    <field name="TOWN" alias="City or Twp"/>
    <field name="VOLUME" alias="Volume"/>
    <field name="PAGE" alias="Page"/>
    <field name="DATE_" alias="Date Recorded"/>
            </fields>
        </layer>

fv 3
<layer>
   <definitionexpression></definitionexpression>
   <enableexport>false</enableexport>
   <name>Subdivisions</name>
   <url>http://gis.linncounty.org/arcgis/rest/services/LandRecords/MapServer/18</url>
   <expressions>
    <expression alias="Subdivision Name" textsearchlabel="Search Subdivision Name">
     <values><value>SUBDIVISIONNAME LIKE '[value]%'</value></values>
    </expression>
   </expressions>
   <graphicalsearchlabel>Use one of the graphical search tools to select Subdivisions</graphicalsearchlabel>
   <spatialsearchlayer>true</spatialsearchlayer>
   <titlefield>SUBDIVISIONNAME</titlefield>
   <links></links>
   <fields all="false">
    <field name="SUBDIVISIONNAME" alias="Name"/>
    <field name="TOWN" alias="City or Twp"/>
    <field name="VOLUME" alias="Volume"/>
    <field name="PAGE" alias="Page"/>
    <field name="DATE_" alias="Date Recorded"/>
   </fields>
   <zoomscale usegeometry="true" zoompercent="1.2"></zoomscale>
  </layer>
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Scott,

   The fact that it works with the OTB SearchWidget would lead me to say you should not worry about creating a new field and the other suggestions of manipulating your data. I agree that it must be a configuration issue. Let me test the application builder package of the eSearch 3.0.7 and see if there is some things wrong with it, maybe something went wrong with the packaging. Also I may ask you to try a eSearchWidget.xml that I provide you.
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Cory,

   Please start a new post so this one is not hijacked by your issue. When you do start a new thread please provide and example of what one would type in for a subdivision search as you neglected to provide this information to you end users in the widget and I have no familiarity with your data.
0 Kudos