Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Oracle Pattern Matching(regexp_like) for csv

978906Dec 19 2012 — edited Dec 19 2012
I have a table offer_detail which contains columns like

Offer_ID Customer_IDS
EF123 100,200,300
EF124 300,700,800
I am writing a query which will have customer id as a paramter. Based on the customer id the results are to filtered.For eg if the input customer id is 100, I should be getting the all the offer_ids that contain the customer id in csv.

I tried using regexp_like function

select offer_id from offer_detail where regexp_like(customer_ids,':INPUT_PARAMETER')It works fine if the paramter is a single value, If the parameter contains multiple values, then this does not work. Is there any work around? Kindly Help. I am using Oracle 11g.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 16 2013
Added on Dec 19 2012
11 comments
910 views