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 47 48 49 50 51 52 53
| [/CODE= SQL]
Create or replace
PROCEDURE ALIM IS
LN$Cpt PLS_INTEGER ;
PROCEDURE LOG (pe_table IN VARCHAR2, pe_dml IN VARCHAR2,
pe_nblignes IN NUMBER, pe_date IN DATE DEFAULT SYSDATE) IS
BEGIN
INSERT INTO RDO_LOG (
NOM_TABLE,
NB_LIGNES_INSEREES,
DATE_TRAITEMENT)
VALUES (pe_table, pe_nblignes, pe_date );
END LOG;
BEGIN
SELECT COUNT(*) INTO LN$Cpt FROM TABLEA;
DBMS_OUTPUT.PUT_LINE( TO_CHAR( LN$Cpt ) || ' enreg_MASS') ;
LOG('TABLEA', 'Count(*)', LN$Cpt);
INSERT INTO TABLEA ( JOUR,ENT,BAT)
SELECT JOUR,ENT,BAT FROM X
UNION
SELECT JOUR,ENT,BAT FROM Y;
LOG('TABLEA', 'INSERT', SQL%ROWCOUNT);
-- insert 2
INSERT INTO RDO_LOG (
NOM_TABLE,
NB_LIGNES_INSEREES,
DATE_TRAITEMENT)
VALUES (pe_table, pe_nblignes, pe_date );
SELECT COUNT(*) INTO LN$Cpt FROM TABLEB;
DBMS_OUTPUT.PUT_LINE( TO_CHAR( LN$Cpt ) || ' enreg_MASS') ;
LOG('TABLEB', 'Count(*)', LN$Cpt);
INSERT INTO TABLEB ( JOUR,ENT,BAT)
SELECT JOUR,ENT,BAT FROM W
UNION
SELECT JOUR,ENT,BAT FROM V;
LOG('TABLEB', 'INSERT', SQL%ROWCOUNT);
END ALIM; |
Partager