Looking for Tool to export data to Textfile
From: Christian Kurz <kurz_at_ani.univie.ac.at>
Date: Tue, 22 Aug 2000 15:01:11 +0200
Message-ID: <8ntti8$vt4$1_at_www.univie.ac.at>
24* END;
DECLARE
*
ERROR at line 1:
Date: Tue, 22 Aug 2000 15:01:11 +0200
Message-ID: <8ntti8$vt4$1_at_www.univie.ac.at>
HI!
Does anyone around here know a tool with which I can export tables from the Oracle Database to Textfiles. Some Freeware would be best. As I have to export hundreds of relatively small file it would be great if it support some automatisation mechanism.
I also tried to use the UTL_FILE package but this wont work.
SQL> ru
1 DECLARE
2 TYPE GenericCurTyp IS REF CURSOR;
3 c1 GenericCurTyp;
4 sess_rec stat_tab%ROWTYPE;
5 value NUMBER;
6 cumpercent NUMBER;
7 filehand UTL_FILE.FILE_TYPE;
8 buffer VARCHAR2 (100);
9 BEGIN
10 filehand := UTL_FILE.FOPEN ('C:\Daten\Output\', 'test1.txt',
); -- The problem seems to be to open the file
11 OPEN c1 FOR
12 SELECT * FROM stat_tab ORDER BY value;
13 LOOP
14 FETCH c1 INTO sess_rec;
15 EXIT WHEN c1%NOTFOUND;
16 value := .....
17 cumpercent := .....
18 buffer := to_char(value) || ' ' ||
to_char(cumpercent);
19 UTL_FILE.PUT_LINE (filehand, buffer);
20 END LOOP;
21 CLOSE c1;
22 UTL_FILE.FCLOSE (filehand);
23 COMMIT;
24* END;
DECLARE
*
ERROR at line 1:
ORA-06510: PL/SQL: unhandled user-defined exception ORA-06512: at "SYS.UTL_FILE", line 98 ORA-06512: at "SYS.UTL_FILE", line 157 ORA-06512: at line 10
Thanks for your help
Christian Received on Tue Aug 22 2000 - 15:01:11 CEST
