BI Publisher (MOSC)

MOSC Banner

Parameter list of values with null check

edited May 26, 2015 6:41AM in BI Publisher (MOSC) 6 commentsAnswered ✓

Hi,

We are trying to find a solution to the following problem in a datamodel. We have a user input parameter called P_ LIST, which contains a comma-separated list of values, for example:

COPENHAGEN,STOCKHOLM,AMSTERDAM

We have a table which contains values as such:

CityPopulation
COPENHAGEN10
STOCKHOLM20
AMSTERDAM30

The user can input one of the following variations into the parameter field:

COPENHAGEN
COPENHAGEN,STOCKHOLM

COPENHAGEN,STOCKHOLM,AMSTERDAM

STOCKHOLM,AMSTERDAM

AMSTERDAM,COPENHAGEN

NULL   (i.e. no input, should show all cities)

The SQL query is:

with cities as (SELECT 'COPENHAGEN' city,10 population from dual

        UNION

        SELECT 'STOCKHOLM' city, 20 population  from dual

Tagged:

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center