Prb Stockage dans un fichier
Bonjour,
Je voudrais stocker toutes les lignes d'une table dans un fichier. J'ai fais un script en PL/SQL et lorsque je l'execute j'ai ce message : chemin de repertoire non valide.
Est ce que quelqu'un pourrait m'aider, svp. Merci
Voici mon code :
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 36 37
| create or replace PROCEDURE Ecrire_TABLE
IS
nomfichier varchar2(100);
TMP varchar2(1000);
id1 PICS.id%type;
nomfic1 PICS.nom%type;
description1 PICS.Auteur%type;
CURSOR C1 IS SELECT id, nom, Auteur from PICS;
fichier UTL_FILE.FILE_TYPE;
BEGIN
OPEN C1;
LOOP
FETCH C1 INTO id1, nomfic1, description1;
EXIT WHEN C1%NOTFOUND;
TMP := TMP || id1 || ' ' || nomfic1 || ' ' || description1;
TMP := TMP || ',';
END LOOP;
CLOSE C1;
TMP := TMP || ');';
fichier := UTL_FILE.FOPEN('C:\','temp.csv','w');
UTL_FILE.PUT_LINE(fichier,TMP);
UTL_FILE.FFLUSH(fichier);
UTL_FILE.FCLOSE(fichier);
dbms_output.put_line (TMP);
END; |