Re: Import Data from TxT to Tables

From: Olsiewicz Mirko <M.Olsiewicz_at_AKAP.DE>
Date: Sat, 21 Jul 2001 21:45:33 GMT
Message-ID: <9evmgk$g7s$00$1_at_news.t-online.com>


[Quoted] [Quoted] I know that sql-loader is not a sql-command but how can I use the features of sql-loader in a procedure
[Quoted] [Quoted] "Stephan Langer" <slanger_at_dixi-wc.de> schrieb im Newsbeitrag [Quoted] [Quoted] news:3B135C07.3C2A6B27_at_dixi-wc.de...
> Hallo Mirko,
>
> sql-loader is not a sql-command, but an programm, so type your command in
 the
> cmd-window, not in the sql
> (sqlldr.exe should stay in $ORACLE_HOME/bin).
>
> hth
> Stephan Langer
>
> Olsiewicz Mirko schrieb:
>
> > How can I implement the SQL Loader in my Prcedure? It Works in an CMD
 Window
> > but when I Type the follwing Text into SQL Plus the Compile say
> > 'Unbekannter Befehl'
> >
> > " sqlldr username/passwort_at_SID control=Controlfile"
> >
> > It is very simple, I think. But I don't know how.
> >
> > Can you help me?
> >
> > Thanx
> >
> > "Sydney Palmer" <sydpalm_at_home.com> schrieb im Newsbeitrag
> > news: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
> > >
> > > 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:33 CEST

Original text of this message