hello,
je suis tombé sur votre thread en parcourant le forum ce matin et j'ai peut être une solution qui evite le regexp. voila le code de ma procédure:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
| create or replace PROCEDURE CREATE_BAK_TABLES(BAKTABLE_LIST IN VARCHAR2)
IS
sSqlStmt VARCHAR2(500) :='';
table_list dbms_utility.uncl_array;
table_length PLS_INTEGER;
ErrNum NUMBER;
ErrMsg VARCHAR2(500);
MsgRes VARCHAR2(500);
BEGIN
dbms_utility.comma_to_table(BAKTABLE_LIST,table_length,table_list);
FOR i in 1..table_list.count LOOP
mon traitement.......
END LOOP;
EXCEPTION
WHEN OTHERS THEN
ErrNum := SQLCODE;
ErrMsg := SQLCODE||SUBSTR(SQLERRM, 1, 150);
MsgRes := ErrMsg;
END; |
j'utilise le package oracle natif "dbms_utility.comma_to_table".
je définis ma liste ( ici des noms de tables ) dans une variable:
DEFINE BAKTABLE_LIST = 'TABLE1, TABLE2, TABLE3'
et je passe cette variable en argument de mon script.
j'espere que ca pourra aider, bon courage
Partager