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 39 40 41 42 43 44 45 46
| DECLARE
caract1 number(2) := NULL;
caract2 number(2) := NULL;
chaine1 varchar2(10) := NULL;
chaine2 varchar2(10) := NULL;
chaine3 varchar2(10) := NULL;
nomTable varchar2(40) := NULL;
champPK varchar2(40) := NULL;
champModifier varchar2(40) := NULL;
champNum number(15,6) :=NULL;
champCaract VARCHAR2(160 BYTE) := NULL;
BEGIN
nomTable = (SELECT tableName FROM INT_QFS_DONNEES_REF WHERE rownum = 1;
champPK = (SELECT recordKey FROM INT_QFS_DONNEES_REF WHERE rownum = 1;
SELECT instr(champPK, '|', 1) INTO caract1 FROM dual;
SELECT instr(champPK, '|', caract1 + 1) INTO caract2 FROM dual;
IF (caract1 > 0) then
SELECT substr(champPK, 1, caract1-1) INTO chaine1 FROM dual;
end IF;
IF (caract2 > 0) then
SELECT substr(champPK, caract1 + 1, length(champPK) - caract2 - 1) INTO chaine2 FROM dual;
SELECT substr(champPK, caract2 + 1, length(champPK)) INTO chaine3 FROM dual;
ELSE
SELECT substr(champPK, caract1 + 1, length(champPK)) INTO chaine2 FROM dual;
end IF;
dbms_output.put_line(chaine1);
dbms_output.put_line(chaine2);
dbms_output.put_line(chaine3);
IF (SELECT actiontype FROM INT_QFS_DONNEES_REF WHERE rownum = 1) = 'D' THEN
delete (SELECT * FROM nomTable AND colonne1 = chaine1 AND colonne2 = chaine2);
champModifier = (SELECT fildName FROM INT_QFS_DONNEES_REF WHERE rownum = 1);
champNum = (SELECT FIELDNUMBER FROM INT_QFS_DONNEES_REF WHERE rownum = 1);
champCaract = (SELECT FIELDCHARVALUE FROM INT_QFS_DONNEES_REF WHERE rownum = 1);
IF (SELECT fildType FROM INT_QFS_DONNEES_REF) = 'N' THEN
(SELECT champModifer FROM nomTable) = champNum;
ELSIF (SELECT fildType FROM INT_QFS_DONNEES_REF) = 'C' THEN
(SELECT champModifer FROM nomTable) = champCaract;
END; |
Partager