[Mapserver-users] Oracle/PHP mapscript issues

chodgson at refractions.net chodgson at refractions.net
Thu Jan 8 15:52:32 PST 2004


I am using PHP-mapscript to dynamically set the DATA statement for my 
oraclespatial layer as follows:

$lha_layer = $map->getLayerByName( 'Local Health Areas' );
$lha_layer->set( 'status', MS_ON );
$statement = "the_geom FROM (SELECT the_geom, a.lha_id as lha_id, $column FROM 
lha_combined_albers a LEFT JOIN lha_stats b ON a.lha_id = b.lha_id)";
$lha_layer->set( 'data', $statement );

When I call $map->draw(), I get the error:

Warning: MapServer Error in msOracleSpatialLayerWhichShapes(): Error parsing 
OracleSpatial DATA variable. Must be 'geometry_column FROM table_name [USING 
SRID srid#]' or 'geometry_column FROM (SELECT stmt)'. 

The select statement inside the () works fine in sqlplus, and the entire data 
statement works fine in the mapfile if I use the mapserv cgi to render the map 
instead of php-mapscript.
In fact, the whole app worked fine before when I was using postgres/postgis, 
I'm just porting it over to oracle spatial.

What am I doing wrong here? Any clues?

Thanks,
Chris Hodgson




More information about the MapServer-users mailing list