trouble with attribute query

John B. Churchill jchurchill at AL.UMCES.EDU
Thu Jul 5 08:20:03 EDT 2007


I figured out the problem I was having.  It has to do with having 
underscores "_" in the text field.  If I replace my underscores with 
hyphens "-", my query works.  This seems to be an odd character for 
Mapserver to weed out but that appears to be what is happening.

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Hi All,

     I'm having trouble executing an Attribute Query when I base the 
query (qitem) on the "filename" field in my shapefile.  I can choose any 
other field and supply the appropriate qstring and everything works fine 
but when I use the filename field I get a "no matching records" found error.

     The text in the long string in the address bar of the browser IS 
complete and DOES match the value in the shapefile.  Perhaps the text 
values in the shapefile field are too long for MapServer or special 
characters like the "." or "-" are causing a problem ?  Can anyone 
confirm or deny either of my theories about this or point to any other 
possibilities ?

The qstring is ...
p016r032_09-09-1986_lt5_doc.img

The qitem is "filename" and it is a text field.

The entire query string in the address bar is ...
http://localhost/cgi-bin/mapserv.exe?qlayer=landsat_4&myitem=landsat_4%2Cfilename&qstring=p016r032_09-09-1986_lt5_doc.img&map=C%3A%5Cms4w%5CApache%5Chtdocs%5Cimg_browser%5Cimg_browser.map&program=%2Fcgi-bin%2Fmapserv&mode=itemnquery&qitem=filename

The error is ...
msQueryByAttributes(): Search returned no results. No matching record(s)
found.

-- 
---------------------------------------------
John B. Churchill, M.S.			http://alx.al.umces.edu/~jchurch/
GIS Specialist				(301) 689-7109

University of Maryland Center for Environmental Science
Appalachian Laboratory			http://www.al.umces.edu/
Environmental Science Education		http://alese.al.umces.edu/

301 Braddock Road			
Frostburg, MD 21532			
FAX - (301) 689-7200			



More information about the mapserver-users mailing list