Oracle: creating value set with query

5k views Asked by At

I have a query which returns a list of values:

WITH temp AS (
    SELECT 108 Name, 'Err1, Err2, Err3' Error FROM DUAL
    UNION ALL
    SELECT 109, 'Err4' FROM DUAL
)
SELECT distinct Name,
    TRIM(REGEXP_SUBSTR(str, '[^,]+', 1, LEVEL)) str
FROM (SELECT Name, Error str FROM temp) t
CONNECT BY INSTR(str, ',', 1, LEVEL - 1) > 0
ORDER BY Name;

enter image description here

I would like to create a value set (Err1, Err2, Err3, Err4) for parameter to be used in oracle concurrent program. However, the validation type 'Table' does not allow to insert such complicated query as shown above.

enter image description here

Is there any way to do so?

1

There are 1 answers

0
Klas Lindbäck On BEST ANSWER

Create a VIEW of your SQL and use the view for validation.

(I'm taking a stab in the dark and assuming that views can be used for the Table validation type.)