Re: Import Data from TxT to Tables

From: Sybrand Bakker <postbus_at_sybrandb.demon.nl>
Date: Sat, 21 Jul 2001 21:45:44 GMT
Message-ID: <th70t3ivsjejd1_at_beta-news.demon.nl>


[Quoted] What about writing a small .cmd file and submitting that through the at command facility? Shouldn't be too difficult. You simply can't call sqlloader from Pl/sql.

Regards,

Sybrand Bakker, Oracle DBA

"Olsiewicz Mirko" <M.Olsiewicz_at_AKAP.DE> wrote in message news:9evsjk$rjq$06$1_at_news.t-online.com...
> Ok I think so too, but I'am new in this Business. Can you say me how can I
> call the SQL Loader from my PL/SQL Programm.
> Because at the Moment we make the same with MSSQL7 and bcp.
>
> "Stephan Langer" <slanger_at_dixi-wc.de> schrieb im Newsbeitrag
> news:3B1369D0.EDB57139_at_dixi-wc.de...
> > Hallo Mirko,
> >
> > in that case i would prefer:
> > - Load all (if it isn't tooo much) into (temporary) tables.
> > - Rewrite your Procedure to move the data from that tables to the ones
 you
 need
> > the data in and
> > - reset / truncate the temp tables
> >
> > IMHO you have more control about the data if it's already in tables - so
 to
> > compare different sets ...
> >
> > hth
> > Stephan Langer
> >
> > Olsiewicz Mirko schrieb:
> >
> > > I get some Files from SAP every Night. Then I must Import the Files
 into
> > > Tables. But not everything in the Files only the data which are
 diffrent. So
> > > this is the reasond why I use Procedure.
> > > "Stephan Langer" <slanger_at_dixi-wc.de> schrieb im Newsbeitrag
> > > news:3B13603B.2BBA44F7_at_dixi-wc.de...
> > > > Hallo,
> > > >
> > > > i'dont know why one wants to user sqlloader in a procedure - bur if:
 how
 about
> > > > the host-command. But be aware the host-command runs on the server,
 not
 the
> > > > client.
> > > >
> > > > hth
> > > > Stephan Langer
> > > >
> > > > Olsiewicz Mirko schrieb:
> > > >
> > > > > I know that sql-loader is not a sql-command but how can I use the
 features
> > > > > of sql-loader in a procedure
> > > > > "Stephan Langer" <slanger_at_dixi-wc.de> schrieb im Newsbeitrag
> > > > > 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:44 CEST

Original text of this message