<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
You have an syntax error. The parameter of FILTER is what you would
write after "WHERE". <br>
In your sql query in your case after where you write "20050049" which
of course can not be evaluated as an boolean value.<br>
You should try something like: <br>
FILTER "identbv=20050049"<br>
<br>
<br>
Bart van den Eijnden wrote:
<blockquote cite="mids326f43e.062@SRV-POSTIX-DFT" type="cite">
  <pre wrap="">Follow-up on this.

It seems that layer-&gt;filter.string only contains the FILTER value and not the whole expression to be used in the where clause.

sprintf(query_string_0_6, "DECLARE mycursor BINARY CURSOR FOR SELECT %s from %s WHERE (%s) and (%s &amp;&amp; setSRID( %s,%s) )", columns_wanted, data_source, layer-&gt;filter.string, geom_column, box3d, user_srid);

Does this sound familiar to anyone?

Best regards,
Bart


Bart van den Eijnden
Syncera IT Solutions
Postbus 270
2600 AG  DELFT

tel.nr.: 015-7512436
email: <a class="moz-txt-link-abbreviated" href="mailto:BEN@Syncera-ITSolutions.nl">BEN@Syncera-ITSolutions.nl</a>

  </pre>
  <blockquote type="cite">
    <blockquote type="cite">
      <blockquote type="cite">
        <pre wrap="">Bart van den Eijnden <a class="moz-txt-link-rfc2396E" href="mailto:BEN@SYNCERA-ITSOLUTIONS.NL">&lt;BEN@SYNCERA-ITSOLUTIONS.NL&gt;</a> 13-9-2005 13:26:44 &gt;&gt;&gt;
        </pre>
      </blockquote>
    </blockquote>
  </blockquote>
  <pre wrap=""><!---->Hi list,

I am running into an issue using Mapscript 4.7 from a few weeks back.

PostGIS layers work fine for map display and query, but as soon as I try to highlight a feature using FILTERITEM and FILTER I get the following error (so it seems the filteritem is not used when building the WHERE clause, the column exists in the database and has the right case):

[13-Sep-2005 13:06:43] PHP Warning:  [MapServer Error]: prepare_database(): Error executing POSTGIS DECLARE (the actual query) statement: 'DECLARE mycursor BINARY CURSOR FOR SELECT identbv::text,asbinary(force_collection(force_2d(the_geom)),'NDR'),OID::text from bouwvergunning.aanvraag WHERE (20050049) and (the_geom &amp;&amp; setSRID( 'BOX3D(114024.650480941 503134.482620259,115117.267932596 503806.862590517)'::BOX3D,find_srid('','bouwvergunning.aanvraag','the_geom') ))' &lt;br&gt;&lt;br&gt;

Postgresql reports the error as 'ERROR:  argument of AND must be type boolean, not type integer ........

This is my LAYER definition:

LAYER
  NAME "bimas"
  METADATA
    wms_title "Bouwvergunningen"
  END
  STATUS OFF
  DEBUG ON
  FILTERITEM "identbv"
  FILTER "20050049"
  TYPE POINT
  CONNECTION "user=stragisweb password=synstragisweb dbname=wormerland host=127.0.0.1"
  CONNECTIONTYPE postgis
  DATA "the_geom from bouwvergunning.aanvraag USING UNIQUE identbv"
  PROJECTION
    "init=epsg:28992"
  END
  MINSCALE 0
  MAXSCALE 10000
  CLASS
    NAME bouwlocaties
    STYLE
      COLOR 255 0 0
      SIZE 12
      SYMBOL "Bouwlocaties"
    END
  END
  TEMPLATE "blank.html"
END

Thanks in advance. Is this fixed in CVS?

Best regards,
Bart

Bart van den Eijnden
Syncera IT Solutions
Postbus 270
2600 AG  DELFT

tel.nr.: 015-7512436
email: <a class="moz-txt-link-abbreviated" href="mailto:BEN@Syncera-ITSolutions.nl">BEN@Syncera-ITSolutions.nl</a>

  </pre>
</blockquote>
<br>
</body>
</html>