<div dir="ltr">The other option is to create yet-another stored procedure wrapper.  In the Mapfile, you'd call the special wrapper stored procedure and it would return the rows to map.</div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Mar 24, 2016 at 8:16 AM, Jeff McKenna <span dir="ltr"><<a href="mailto:jmckenna@gatewaygeomatics.com" target="_blank">jmckenna@gatewaygeomatics.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Martin,<br>
<br>
Have you tried using a virtual spatial layer (.ovf) file to manage this?  You can include a "<SrcSQL>" tag to run your stored procedure.  See examples at <a href="http://mapserver.org/input/vector/VirtualSpatialData.html" rel="noreferrer" target="_blank">http://mapserver.org/input/vector/VirtualSpatialData.html</a> More details of that driver at: <a href="http://www.gdal.org/drv_vrt.html" rel="noreferrer" target="_blank">http://www.gdal.org/drv_vrt.html</a><br>
<br>
Otherwise, I have seen others on this mailing list use stored procedures in the DATA statement of the mapfile, such as:<br>
<br>
DATA "the_geom from (select the_geom, id, name, myprocedure() as style from states) as foo using srid=4326 using unique id"<br>
<br>
Maybe the ovf is the way to go for your case, not sure.<br>
<br>
-jeff<br>
<br>
-- <br>
Jeff McKenna<br>
MapServer Consulting and Training Services<br>
<a href="http://www.gatewaygeomatics.com/" rel="noreferrer" target="_blank">http://www.gatewaygeomatics.com/</a><br>
<br>
<br>
<br>
<br>
On 2016-03-24 6:59 AM, Martin Icking wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
One of the Oracle based sources we are publishing is using Oracle context<br>
variables to enable Oracle's fine grained access control.<br>
So we are in the need to set these context variables (e.g. current username)<br>
prior to doing the select defined by MapServer's DATA statement. In other<br>
applications we do that by calling a set_context (...) stored procedure<br>
prior to any data requests.<br>
Is there any possibility in MapServer to send a pre-request statement to the<br>
database? A current work-around is to set the context at logon time but that<br>
means that we need a new logon for every request that needs a different user<br>
context, not optimal for websites with many users. We'd prefer to have a<br>
single logon that can be re-used for all requests.<br>
If there is currently no way to handle this in MapServer we'd like to extend<br>
the Oracle layer's capabilities. Any suggestion by the MS developers on<br>
where we should place the needed extension in the mapfile (e.g. adding an<br>
additional keyword at the USING part of the data statement or using new<br>
layer metadata)?<br>
Any interest in generalizing this approach?<br>
<br>
Tx<br>
Martin<br>
<br>
</blockquote>
<br>
_______________________________________________<br>
mapserver-users mailing list<br>
<a href="mailto:mapserver-users@lists.osgeo.org" target="_blank">mapserver-users@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/mapserver-users" rel="noreferrer" target="_blank">http://lists.osgeo.org/mailman/listinfo/mapserver-users</a></blockquote></div><br></div>