[mapserver-users] Query length with mapscript.

Paul moen pmoen at offroadsoftware.com
Thu Oct 16 23:15:33 EDT 2008


Is there a maximum length of the query text when setting a filter  
with php mapscript?

For example,

I use
$tempLayer->setfilter('contract_id IN  
(26,27,1093,608,596,134,111,36,37,4599,95,59,41,42,605,117,47,105,146,13 
0,123,122,5017,98,66,67,68,69,133,71,131,74,75,76,77,148,94,81,82,108,97 
, 
85,86,4974,88,89,90,91,93,100,1956,124,125,140,145,141,139,157,152,154,1 
56,158,5018,183,162,164,165,173,167,168,169,171,334,174,2083,184,177,743 
, 
182,186,187,188,332,190,2092,193,195,196,1107,199,200,201,202,203,205,20 
6,5015,208,209,218,212,213,214,219,221,222,224,225,226,229,4695,232,235, 
238,239,241,244,245,246,247,2015,251,2016,253,256,258,260,261,466,265,26 
6,267,268,269,270,593,381,274,595,276,279,280,281,607,283,284,285,286,20 
45,299,298,291,292,293,295,296,297,302,1955,304,306,333,309,310,311,385, 
316,318,3456,123)');

and I get the error

PHP Warning:  [MapServer Error]: prepare_database(): Error executing  
POSTGIS DECLARE (the actual query) statement: 'DECLARE mycursor  
BINARY CURSOR FOR SELECT asbinary(force_collection(force_2d 
(geom_pnt)),'NDR'),parcel_id::text from (select  
parcel_id,county,contract_id,land_title_holder,parcel_location,ST_Centro 
id(geom) as geom_pnt FROM parcels) as foo WHERE ((contract_id IN  
(26,27,1093,608,596,134,111,36,37,4599,95,59,41,42,605,117,47,105,146,13 
0,123,122,5017,98,66,67,68,69,133,71,131,74,75,76,77,148,94,81,82,108,97 
, 
85,86,4974,88,89,90,91,93,100,1956,124,125,140,145,141,139,157,152,154,1 
56,158,5018,183,162,164,165,173,167,168,169,171,334,174,2083,184,177,743 
, 
182,186,187,188,332,190,2092,193,195,196,1107,199,200,201,202,203,205,20 
6,5015,208,209,218,212,213,214,219,221,222,224,225,226,229,4695,232,235, 
238,239,241,244,245,246,247,2015,251,2016,253,256,258,260,261,466,265,26 
6,267,268,269,270,593,381,274,595,276,279,280,281,607,283,284,285,286,20 
45,299,298,291,292,293,295,296,297,302,1955,304,306,333,309,310,311,385, 
316,318,3

which truncates the sql statement.

Is there a way to increase the length of the query allowed?

Thanks,

Paul



More information about the mapserver-users mailing list