syhctl
asked on
ORACLE SQL/PL case statement - using with IN LIST
Hi all,
I have writtent he following CASE Statement in the
criteria for DeptID
DEPTID =
CASE :1 WHEN '12345'
THEN '555111' END -- This works and brings back the specified department.
I have tried many ways to add more deparment numbers but I get a an error.
I've tried
CASE :1 WHEN '12345'
THEN IN ("555111','12345')
also I have tried:
CASE :1 WHEN '12345'
THEN DEPTID IN ("555111','123456')
The only one that works is when I have only one department number. Is this because CASE statements bring only bring back 1 result?
Thanks much for your help.
Syhctl
Is there a way for me to list more than one dept number in a Case Statement without have to create multiple Statements?
Thanks,
Syhctl
I have writtent he following CASE Statement in the
criteria for DeptID
DEPTID =
CASE :1 WHEN '12345'
THEN '555111' END -- This works and brings back the specified department.
I have tried many ways to add more deparment numbers but I get a an error.
I've tried
CASE :1 WHEN '12345'
THEN IN ("555111','12345')
also I have tried:
CASE :1 WHEN '12345'
THEN DEPTID IN ("555111','123456')
The only one that works is when I have only one department number. Is this because CASE statements bring only bring back 1 result?
Thanks much for your help.
Syhctl
Is there a way for me to list more than one dept number in a Case Statement without have to create multiple Statements?
Thanks,
Syhctl
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
https://www.experts-exchange.com/questions/22876537/SQL-PL-Oracle-PeopleSoft-What-experession-to-use-retrieve-specific-data-IF-FIELD-prompt-value-then-return-specific-data.html