Advertisement
Advertisement
| 07.10.2008 at 06:01PM PDT, ID: 23555959 |
|
[x]
Attachment Details
|
||
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: |
CREATE OR REPLACE FUNCTION DB.GET_PRCMAP (
pSRC_SYSTEM IN VARCHAR,
pMAPPING_CODE IN VARCHAR)
RETURN MapList PIPELINED IS ???
BEGIN
FOR x IN
(
SELECT
MIN(PRC.report_codes) KEEP (dense_rank first order by M.Precedence DESC) Report_Codes,
MIN(M.source_code_a) KEEP (dense_rank first order by M.Precedence DESC) source_code_a,
MIN(M.map1) KEEP (dense_rank first order by M.Precedence DESC) map_value_a,
MIN(M.map2) KEEP (dense_rank first order by M.Precedence DESC) map_value_b,
FROM DB.REF_MAP_DATA_MAPS M
INNER JOIN
DB.hr_primary_report prc
ON PRC.Primary_Report_Codes LIKE M.source_code_a || '%'
WHERE M.src_system = pSRC_SYSTEM
AND M.mapping_code = pMAPPING_CODE
AND M.source_code_b IN ('DEFAULT','N/A')
GROUP BY
PRC.report_codes
)
LOOP
PIPE ROW(x);
END LOOP;
RETURN;
END;
|