Re: Import Data from TxT to Tables

From: Sydney Palmer <sydpalm_at_home.com>
Date: Sat, 21 Jul 2001 21:45:28 GMT
Message-ID: <3B134EC9.30D7_at_home.com>


Olsiewicz Mirko wrote:
>
> Hello,
>
> I get some Files from SAP (TXT, ZKS). This Files are all in one Directory.
> Now I must Import each File in a Table.
> I saw a Message abaut IMP, but this Tool is not Usefull to me. I need it in
> a Procedure. Can you show me this with an Example.
>
> This is what I have found, but it doesn't work
>
> 1 declare f utl_file.file_type;
> 2 p varchar2(255);
> 3 begin
> 4 f:= utl_file.fopen('c:','skost.txt','r');
> 5 loop
> 6 begin
> 7 utl_file.get_line(f, p);
> 8 dbms_output.put_line(p);
> 9 exception
> 10 when no_data_found then
> 11 exit;
> 12 when utl_file.invalid_operation then
> 13 exit;
> 14 when utl_file.invalid_path then
> 15 exit;
> 16 end;
> 17 end loop;
> 18 utl_file.fclose(f);
> 19* end;
> declare f utl_file.file_type;
> *
> FEHLER in Zeile 1:
> ORA-06510: PL/SQL: Unbehandelte benutzerdefinierte Ausnahmebedingung
> (exception)
> ORA-06512: in "SYS.UTL_FILE", Zeile 102
> ORA-06512: in "SYS.UTL_FILE", Zeile 255
> ORA-06512: in Zeile 7
>
> Thanx

[Quoted] [Quoted] Why not use the SQL*Loader utility, which can handle quite a few input text-file format configurations?

Yours,

Geoff Houck Received on Sat Jul 21 2001 - 23:45:28 CEST

Original text of this message