Hi
I want to write a query where the user can input either:
(a) a single customer_id, to return all records for that customer
or
(b) a list of several customer_ids, perhaps seperated by commas, to return all records for those customers
or
(c) Null, to return records for ALL customer_id's.
I've tried something like:
... where cust_id in NVL('&customer_id','%')
[that only works for (a) - nothing returned for (b) & (c)]
or maybe I should use LIKE instead of IN ?
Can anyone point me to a workable solution?
I want to write a query where the user can input either:
(a) a single customer_id, to return all records for that customer
or
(b) a list of several customer_ids, perhaps seperated by commas, to return all records for those customers
or
(c) Null, to return records for ALL customer_id's.
I've tried something like:
... where cust_id in NVL('&customer_id','%')
[that only works for (a) - nothing returned for (b) & (c)]
or maybe I should use LIKE instead of IN ?
Can anyone point me to a workable solution?