Hi All, I do have a table, which have comma separated string (e.g ‘2802,1680,2950,1987’) value. Would like to read this and compare into PL/SQL block using the IF condition.
create table test (parameter_name varchar2(30),value varchar2(200);
insert into test values ('FUL_DEL_CLNTS','2802,1680,2950,1987');
DECLARE
l_clnt_id NUMBER := 2802;
l_val VARCHAR2(200);
BEGIN
SELECT VALUE INTO l_val FROM test WHERE parameter_name = 'FUL_DEL_CLNTS';
dbms_output.put_line('Client value -' || l_val);
IF l_clnt_id IN l_val --‘2802,1680,2950,1987’
THEN
dbms_output.put_line('Value exists - ' || l_clnt_id);
--some calculation
ELSE
dbms_output.put_line('Value do not exists - ' || l_clnt_id);
--some calculation
END IF;
END;