I have a group of users who run scripts frequently. I write these scripts for them and usually prompt them for a variable. I am familiar with that. However, I've wrote a script recently and made multiple iterations of it with only one thing changed: a list (EXISTS IN (x, y, z) in script 1, EXISTS IN (a,b,c) in script 2). Is there a way I can prompt my user to select which list they'd like to run, so I can simplify their scripts?
Code, simplified for privacy:
SELECT firstname, lastname
FROM tablename
WHERE somecolumn = &CodeNumber
AND EXISTS (
SELECT 1
FROM table2
WHERE anothercolumn = somecolumn
AND anotherCode IN ('A','B','C')
)
Right now, that script has a prompt for Code Number but I'd also like a prompt for what list "anotherCode" will be (either (a,b,c) or (x,y,z) for example, though there are many more than that in reality)
I thought about making a prompt that says something like this:
accept runOption char format A1 prompt 'Type 1 for (a,b,c) or 2 for (x,y,z) '
but even once I've got the run option, I don't know how to "translate that" to the list. Thoughts? TYIA.
SQL Developer version 22.2.0.173 ; Oracle 19c