CREATE OR REPLACE PROCEDURE testopsub001b IS
vcValParam2 VARCHAR2(32767);
vcValParam3 VARCHAR2(32767;
CURSOR C_OPLOPCOD IS
SELECT FIOPF.FIOPF_COD,OPLOP_COD FROM OPLOP,FIOPF
WHERE OPLOP.FIOPF_COD = FIOPF.FIOPF_COD
AND FIOPF.TOTIE_CODSOC = 7
AND FIOPF.TASTA_COD <>'A'
AND FIOPF.TASTA_COD <>'S';
ivcVAL2 VARCHAR(8);
ivcVAL3 VARCHAR(8);
BEGIN
OPEN C_OPLOPCOD ;
FOR i IN 1..3637
LOOP
FETCH C_OPLOPCOD INTO ivcVAL2,ivcVAL3;
EXIT WHEN C_OPLOPCOD%NOTFOUND;
IF (vcValParam2 IS NULL) THEN
vcValParam2 := ''||(ivcVAL2);
ELSE
vcValParam2 := vcValParam2||'!'||(ivcVAL2);
END IF;
IF (vcValParam3 IS NULL) THEN
vcValParam3 := ''||(ivcVAL3);
ELSE
vcValParam3 := vcValParam3||'!'||(ivcVAL3);
END IF;
END LOOP;
LOOP
FETCH C_OPLOPCOD INTO ivcVAL2,ivcVAL3;
EXIT WHEN C_OPLOPCOD%NOTFOUND;
-- ton traitement
END LOOP;
CLOSE C_OPLOPCOD;
vcValParam2 := vcValParam2||'!';
vcValParam3 := vcValParam3||'!';
END;