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 31 32 33 34 35 36 37 38
|
FUNCTION F_PPM_CAT(p_cat IN VARCHAR2)
RETURN VARCHAR2
IS
CURSOR c IS
SELECT DISTINCT PPM
FROM OBJ, EVT
WHERE obj.code = evt.code
AND obj.cat = p_cat
ORDER BY ppm;
v_retour VARCHAR2(4000);
BEGIN
FOR r IN c
LOOP
v_retour := LTRIM(v_retour || ','||r.ppm, ',');
END LOOP;
RETURN v_retour;
END;
FUNCTION F_PPM_OBJ(p_code IN VARCHAR2)
RETURN VARCHAR2
IS
CURSOR c IS
SELECT DISTINCT PPM
FROM EVT
WHERE evt.code = p_code
ORDER BY ppm;
v_retour VARCHAR2(4000);
BEGIN
FOR r IN c
LOOP
v_retour := LTRIM(v_retour || ','||r.ppm, ',');
END LOOP;
RETURN v_retour;
END;
SELECT code, cat, F_PPM_OBJ(code), F_PPM_CAT(cat)
FROM OBJ
WHERE F_PPM_OBJ(code) <> F_PPM_CAT(cat) |
Partager