0

I have a IN parameter for P_R4GSTATE where I am getting values for the procedure as "Rajasthan,Maharashtra,Haryana"

And the procedure is below:

PROCEDURE  GET_VENDOR_INFO

(
    PVENDOR_NAME IN NVARCHAR2,
    P_R4GSTATE IN NVARCHAR2,
    P_OUTVENDOR OUT SYS_REFCURSOR
)

AS

BEGIN 

OPEN P_OUTVENDOR FOR
SELECT  * FROM IPCOLO_IPFEE_CALC_MST WHERE CIRCLE=P_R4GSTATE;

END IF;

END GET_VENDOR_INFO;

The issue is that data might be their in any one of those State in the table, how to execute and check for that.

1

1 Answer 1

2

Split it to rows and use in IN clause:

open p_outvendor for
select  * 
from ipcolo_ipfee_calc_mst 
where circle in (select regexp_substr(p_r4gstate, '[^,]+', 1, level)
                 from dual
                 connect by level <= regexp_count(p_r4gstate, ',') + 1
                );
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.