DECLARE
l_code_combination_id NUMBER;
l_boolean BOOLEAN;
l_segment_array apps.fnd_flex_ext.segmentarray;
l_segment VARCHAR2(155):= '10.7110.64110.00.0000.0000';
l_segment_count NUMBER;
l_structure_number apps.fnd_id_flex_structures.id_flex_num%TYPE;
l_id_flex_code apps.fnd_id_flex_structures.id_flex_code%TYPE;
g_user_id NUMBER:= 1896;
g_resp_id NUMBER:= 50774;
g_resp_appl_id NUMBER:= 707;
ERR EXCEPTION;
BEGIN
apps.fnd_global.apps_initialize (g_user_id, g_resp_id, g_resp_appl_id);
DBMS_OUTPUT.put_line ('SYSDATE'||SYSDATE);
SELECT fifs.id_flex_num, fifs.id_flex_code
INTO l_structure_number, l_id_flex_code
FROM apps.fnd_id_flex_structures fifs
WHERE fifs.id_flex_code = 'GL#'
AND fifs.id_flex_structure_code = 'XXPDH_ACCOUNTING_FLEXFIELD';
SELECT REGEXP_COUNT (l_segment, '[^.]+')
INTO l_segment_count
FROM dual;
/* splitting the string into individual segments */
FOR i in 1..l_segment_count
LOOP
SELECT REGEXP_SUBSTR (l_segment, '[^.]+', 1, i)
INTO l_segment_array(i)
FROM dual;
END LOOP;
l_boolean :=
apps.fnd_flex_ext.get_combination_id (
application_short_name => 'SQLGL',
key_flex_code => l_id_flex_code,
structure_number => l_structure_number,
validation_date => SYSDATE,
n_segments => 6,
segments => l_segment_array,
combination_id => l_code_combination_id,
data_set => -1);
IF l_code_combination_id IS NULL
THEN
RAISE ERR;
ELSE
DBMS_OUTPUT.put_line ('l_code_combination_id - '||l_code_combination_id);
END IF;
EXCEPTION
WHEN ERR
THEN
DBMS_OUTPUT.put_line (SQLERRM);
WHEN OTHERS
THEN
DBMS_OUTPUT.put_line (SQLERRM);
END;
l_code_combination_id NUMBER;
l_boolean BOOLEAN;
l_segment_array apps.fnd_flex_ext.segmentarray;
l_segment VARCHAR2(155):= '10.7110.64110.00.0000.0000';
l_segment_count NUMBER;
l_structure_number apps.fnd_id_flex_structures.id_flex_num%TYPE;
l_id_flex_code apps.fnd_id_flex_structures.id_flex_code%TYPE;
g_user_id NUMBER:= 1896;
g_resp_id NUMBER:= 50774;
g_resp_appl_id NUMBER:= 707;
ERR EXCEPTION;
BEGIN
apps.fnd_global.apps_initialize (g_user_id, g_resp_id, g_resp_appl_id);
DBMS_OUTPUT.put_line ('SYSDATE'||SYSDATE);
SELECT fifs.id_flex_num, fifs.id_flex_code
INTO l_structure_number, l_id_flex_code
FROM apps.fnd_id_flex_structures fifs
WHERE fifs.id_flex_code = 'GL#'
AND fifs.id_flex_structure_code = 'XXPDH_ACCOUNTING_FLEXFIELD';
SELECT REGEXP_COUNT (l_segment, '[^.]+')
INTO l_segment_count
FROM dual;
/* splitting the string into individual segments */
FOR i in 1..l_segment_count
LOOP
SELECT REGEXP_SUBSTR (l_segment, '[^.]+', 1, i)
INTO l_segment_array(i)
FROM dual;
END LOOP;
l_boolean :=
apps.fnd_flex_ext.get_combination_id (
application_short_name => 'SQLGL',
key_flex_code => l_id_flex_code,
structure_number => l_structure_number,
validation_date => SYSDATE,
n_segments => 6,
segments => l_segment_array,
combination_id => l_code_combination_id,
data_set => -1);
IF l_code_combination_id IS NULL
THEN
RAISE ERR;
ELSE
DBMS_OUTPUT.put_line ('l_code_combination_id - '||l_code_combination_id);
END IF;
EXCEPTION
WHEN ERR
THEN
DBMS_OUTPUT.put_line (SQLERRM);
WHEN OTHERS
THEN
DBMS_OUTPUT.put_line (SQLERRM);
END;