Il vous suffit de modifier votre Modèle de page (en HTML) et d'ajouter dans le HEAD de votre modèle la ligne suivante :
[...]Voila.[...]
[...]Voila.[...]
|
|
select * from NATIONALITE where rownum < 2
MERGE INTO NATIONALITE A USING (SELECT 'YUG' as "NATIONALITE_ID", 'YOUGOSLAVE' as "NATIONALITE_LIBELLE" FROM DUAL) B ON (A.NATIONALITE_ID = B.NATIONALITE_ID) WHEN NOT MATCHED THEN INSERT ( NATIONALITE_ID, NATIONALITE_LIBELLE) VALUES ( B.NATIONALITE_ID, B.NATIONALITE_LIBELLE) WHEN MATCHED THEN UPDATE SET A.NATIONALITE_LIBELLE = B.NATIONALITE_LIBELLE; COMMIT;C’est tout simple avec Toad, cela facilite grandement la tache sur ce genre d’opération. (Pour le coup, un truncate, et Insert Statement aurait bien également bien fonctionner)
CREATE OR REPLACE PROCEDURE SU.REBUILD_INDEX (ma_table IN VARCHAR2) IS CURSOR CURS_REBUILD IS -- rebuild select 'ALTER INDEX ' || index_name || ' REBUILD ' as txt_sql from user_indexes where UPPER(table_name) = UPPER(ma_table) and INDEX_TYPE!='LOB'; R1 CURS_REBUILD%ROWTYPE; CURSOR CURS_STRUCT IS -- validate structure select 'ANALYZE INDEX ' || index_name || ' VALIDATE STRUCTURE ' as txt_sql from user_indexes where UPPER(table_name) = UPPER(ma_table) and INDEX_TYPE!='LOB'; R2 CURS_STRUCT%ROWTYPE; CURSOR CURS_STAT IS -- stat Analyse select 'Analyze Table ' || UPPER(ma_table) || ' Estimate Statistics ' as txt_sql from dual; R3 CURS_STAT%ROWTYPE; BEGIN ---------rebuild ---------------------------------------------------- OPEN CURS_REBUILD; LOOP FETCH CURS_REBUILD INTO R1; EXIT WHEN CURS_REBUILD%NOTFOUND; EXECUTE IMMEDIATE R1.txt_sql; END LOOP; CLOSE CURS_REBUILD; DBMS_OUTPUT.PUT_LINE('CURS_REBUILD 1 ok : TABLE : ' || ma_table); ----------validate structure--------------------------------------------------- OPEN CURS_STRUCT; LOOP FETCH CURS_STRUCT INTO R2; EXIT WHEN CURS_STRUCT%NOTFOUND; EXECUTE IMMEDIATE R2.txt_sql; END LOOP; CLOSE CURS_STRUCT; DBMS_OUTPUT.PUT_LINE('CURS_REBUILD 2 ok : TABLE : ' || ma_table); -----------stat Analyse-------------------------------------------------- OPEN CURS_STAT; LOOP FETCH CURS_STAT INTO R3; EXIT WHEN CURS_STAT%NOTFOUND; EXECUTE IMMEDIATE R3.txt_sql; END LOOP; CLOSE CURS_STAT; DBMS_OUTPUT.PUT_LINE('CURS_REBUILD 3 ok : TABLE : ' || ma_table); END; /