4

I have a SQL view which takes two parameters. One of these parameters is a list of numbers in string form. I can't for the life of me figure out if Geoserver can take this list and parse it.

The basic SQL query i've set up works as below

SELECT * FROM table WHERE id IN '%list%' AND layer = '%layer_name%'

When I put the default value for %list% as "1, 2 ,3" as an example, the call to viewparams might look like this

viewparams=layer_name:'layer_y';ids:1,2,3

Which fails. I've figured out that viewparams uses semicolons to distinguish between parameter types, and commas as a way to distinguish between viewparams for different layers. So I need a way of encapsulating my list of id values so that geoserver can parse them correctly.

Does anyone know how to do this?

0 Answers0