[Mapserver-users] querybyattributes with Postgres/Postgis Layer

Nicol Hermann mapserver at geochem.de
Wed Nov 26 13:32:06 EST 2003


Dear List,

i trying to do a querybyattributes Query with a Postgres/Postgis layer
and get the following error:

Warning: [MapServer Error]: prep_DB(): Error executing POSTGIS DECLARE
(the actual query) statement: 'DECLARE mycursor BINARY CURSOR FOR SELECT
plzort01::text,asbinary(force_collection(force_2d(the_geom)),'NDR'),OID::text from plz_gebiete WHERE (Mutterstadt) and (the_geom && setSRID( 'BOX3D(5.865627 46.57242768,15.039879 55.75900832)'::BOX3D,find_srid('','plz_gebiete','the_geom') ))'

here is the relevant part of  my code:

$layer = $Map ->getLayerbyname("Regionen");
$layer -> set("status", MS_ON );
$status = $layer->querybyattributes("plzort01", "Mutterstadt",
MS_MULTIPLE);

It seems that the 'qitem' (plzort01) won't be evaluated because it is
not present in the SQL statement.
I also tried the qitem with upper case. The same error appears.

The debugging message on my shell says: 
ERROR:  Attribute "mutterstadt" not found

My Postgis Version is: Mappostgis.c - version of June 12/2003. 
and i`am using Mapserver 4.0.1 on a Linux box.

Does anybody know how I can solve this problem?
Many thanks
Nicol


-- 
Nicol Hermann <mapserver at geochem.de>




More information about the mapserver-users mailing list