ORACLE 9i : ORA-01031: privilèges insuffisants
Bonjour,
J'appelle une fonction test_isn comme suit:
Code:
1 2 3 4 5 6 7 8
|
declare
toto number;
begin
toto:= test_isn;
end; |
La fonction test_isn appelée est comme suit:
Code:
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
|
CREATE OR REPLACE FUNCTION test_isn RETURN NUMBER IS
test_exception EXCEPTION;
i_retcode NUMBER;
v_nb_ligne_lu NUMBER:=0;
fichier_tmp_vide EXCEPTION;
BEGIN
i_retcode:=test_isn1;
RETURN 0;
EXCEPTION
WHEN test_exception THEN
dbms_output.put_line('Erreur TEST !!!');
RETURN 1;
WHEN fichier_tmp_vide THEN --fichier temporaire vide
dbms_output.put_line('Erreur Fichier Vide');
dbms_output.put_line('Erreur :'||SQLERRM);
ROLLBACK;
RETURN 1;
WHEN others -- autre cause de erreur
THEN
dbms_output.put_line('Autres Erreurs');
dbms_output.put_line('Erreur :'||SQLERRM);
ROLLBACK;
RETURN 1;
END; |
La fonction test_isn1 appelée dans la fonction test_isn est comme suit:
Code:
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
|
whenever SQLERROR exit SQL.SQLCODE;
CREATE OR REPLACE function test_isn1 RETURN NUMBER IS
test_exception EXCEPTION;
BEGIN
DBMS_OUTPUT.put_line ('Avant create table');
DBMS_OUTPUT.put_line ('create table nows2p0.TEST_ISN_TABLE (toto number(1))');
execute immediate 'create table nows2p0.TEST_ISN_TABLE (toto number(1))';
DBMS_OUTPUT.put_line ('APRES create table');
return 0;
EXCEPTION
WHEN test_exception THEN
dbms_output.put_line('Erreur TEST !!!');
RETURN 1;
WHEN OTHERS -- FIN DU TRAITEMENT KO
THEN
DBMS_OUTPUT.put_line ('Erreur :' || SQLERRM);
DBMS_OUTPUT.put_line ( 'Procédure test_isn1 KO le '||TO_CHAR (SYSDATE, 'DD/MM/YYYY HH24:mi'));
ROLLBACK;
-- RAISE;
RETURN 1;
END;
/
EXIT |
Quand j'appelle la fonction test_isn, j'ai le résultat suivant:
Citation:
Avant create table
create table nows2p0.TEST_ISN_TABLE (toto number(1))
Erreur :ORA-01031: privilèges insuffisants
Procédure test_isn1 KO le 11/03/2010 11:40
--> Je ne comprend pas ce pb de privilège, car si j'execute l'ordre de création de table directement sous TOAD, ça fonctionne et la table est belle et bien créée.
Help... Merci d'avance pour votre aide.