I have a taken following code from Community,
SET SERVEROUTPUT ON;
DECLARE
v_Str VARCHAR2(100);
V_STR2 VARCHAR2(100);
result1 VARCHAR2(100);
BEGIN
v_Str := '600,1001,500,200,300,400' ;
v_Str2 :='100,200' ;
with testdata as(
select v_Str v_test1, v_Str2 v_test2 from dual )
select
trim(',' from
regexp_replace(
regexp_replace(','||replace(v_test1,',',',,')||','
,','||replace('('||v_test2||')',',',')|(')||','
)
,',{2,}',','
)
) result into result1
from testdata ;
DBMS_OUTPUT.PUT_LINE ( 'Result set values are: '||result1 );
END;
Result Set coming in following way:
PL/SQL procedure successfully completed.
Result set values are: 600,1,500,300,400
I need in such a way : 1001 is not in v_str2 but its getting partial string replace, I want only if the string exact match then it should find/ replace or it should ignore. Can any one please help?
Thanks