CREATE OR REPLACE PACKAGE APPS.xxparam_pkg
AS
-- PROCEDURE create_platter (x_errbuf OUT VARCHAR2,
-- x_retcode OUT VARCHAR2,
-- p_dummy_val IN VARCHAR2,
-- p_list_val IN VARCHAR2);
FUNCTION get_selected_list (p_val VARCHAR2)
RETURN VARCHAR2;
FUNCTION xxget_no_duplicate (p_value VARCHAR2)
RETURN VARCHAR2;
END xxparam_pkg;
/
CREATE OR REPLACE PACKAGE BODY APPS.xxparam_pkg
AS
--Package level variable which holds the value
v_selected_list VARCHAR2 (1000) := NULL;
-- PROCEDURE create_platter (x_errbuf OUT VARCHAR2,
-- x_retcode OUT VARCHAR2,
-- p_dummy_val IN VARCHAR2,
-- p_list_val IN VARCHAR2)
-- IS
-- BEGIN
-- --This will have the last selected values. Just ignore it :)
---- fnd_file.put_line (fnd_file.LOG, 'p_dummy_list : ' || p_dummy_val);
---- fnd_file.put_line (fnd_file.LOG, 'p_list_Values : ' || p_list_val);
-- null; END create_platter;
FUNCTION get_selected_list (p_val VARCHAR2)
RETURN VARCHAR2
IS
BEGIN
IF p_val = '0'
THEN
v_selected_list := NULL;
ELSE
--Concatenate the selected value to the existing list
SELECT DISTINCT
NVL2 (v_selected_list,
v_selected_list || ',',
v_selected_list)
|| p_val
INTO v_selected_list
FROM DUAL;
END IF;
RETURN v_selected_list;
END;
FUNCTION xxget_no_duplicate (p_value VARCHAR2)
RETURN VARCHAR2
AS
l_value VARCHAR2 (2000);
BEGIN
SELECT REGEXP_REPLACE (p_value, '(^|,)([^,]*)(,\2)+', '\1\2')
INTO l_value
FROM DUAL;
RETURN l_value;
EXCEPTION
WHEN OTHERS
THEN
RETURN p_value;
END xxget_no_duplicate;
END;
/
No comments:
Post a Comment