This is a discussion on [NEWBIE] SQLLOADER - Load from multiple files within the Oracle Miscellaneous forums, part of the Oracle Database category; --> Hi, i've to load data from multiple file (eg. data01.dat data02.dat data03.dat data04.dat ) but i can now these ...
| |||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| Hi, i've to load data from multiple file (eg. data01.dat data02.dat data03.dat data04.dat ) but i can now these file's name only in runtime, when i launch the sqlloader command. So I cannot specify them on controlfile. How it works with sqlloader? Thx!! |
| |||
| Emanuele wrote: > Hi, > i've to load data from multiple file > (eg. > data01.dat > data02.dat > data03.dat > data04.dat > ) > > but i can now these file's name only in runtime, when i launch the > sqlloader command. So I cannot specify them on controlfile. > > How it works with sqlloader? > > Thx!! Not well unless you use Perl or another scripting language. -- Daniel A. Morgan University of Washington damorgan@x.washington.edu (replace 'x' with 'u' to respond) |
| |||
| To qualify my post - I consider myself a programming "newbie" but am Oracle 8i certified & have 5 years experience using oracle 7.3.4 & 8i. I'm working on a similar project and had the same question. I'm fortunate that I only have to deal with one file at runtime, so I'm considering forcing the output from the other database to consistently use the same file name, or perhaps copy it to an archive & then rename it (to the consistent name in the control file) with a batch file that would also call SQLLoader. I'm still in the conceptual / design stages though... Regards, db "Daniel Morgan" <damorgan@x.washington.edu> wrote in message news:1091758948.416507@yasure... > Emanuele wrote: > > Hi, > > i've to load data from multiple file > > (eg. > > data01.dat > > data02.dat > > data03.dat > > data04.dat > > ) > > > > but i can now these file's name only in runtime, when i launch the > > sqlloader command. So I cannot specify them on controlfile. > > > > How it works with sqlloader? > > > > Thx!! > > Not well unless you use Perl or another scripting language. > > -- > Daniel A. Morgan > University of Washington > damorgan@x.washington.edu > (replace 'x' with 'u' to respond) > |
| |||
| Daniel and DB, Why don't you dynamically create the control file at runtime? For example: echo "LOAD DATA" > dyn_control.ctl for datafile in `ls *.dat`; do echo "INFILE $datafile" >> dyn_control.ctl done echo "INTO TABLE table1 ...." >> dyn_control.ctl Andy "dbman63" <dbman63@yahoo.com> wrote in message news:<DHZSc.876$qB1.170@fe25.usenetserver.com>... > To qualify my post - I consider myself a programming "newbie" but am Oracle > 8i certified & have 5 years experience using oracle 7.3.4 & 8i. I'm working > on a similar project and had the same question. I'm fortunate that I only > have to deal with one file at runtime, so I'm considering forcing the > output from the other database to consistently use the same file name, or > perhaps copy it to an archive & then rename it (to the consistent name in > the control file) with a batch file that would also call SQLLoader. I'm > still in the conceptual / design stages though... > > Regards, > db > > "Daniel Morgan" <damorgan@x.washington.edu> wrote in message > news:1091758948.416507@yasure... > > Emanuele wrote: > > > Hi, > > > i've to load data from multiple file > > > (eg. > > > data01.dat > > > data02.dat > > > data03.dat > > > data04.dat > > > ) > > > > > > but i can now these file's name only in runtime, when i launch the > > > sqlloader command. So I cannot specify them on controlfile. > > > > > > How it works with sqlloader? > > > > > > Thx!! > > > > Not well unless you use Perl or another scripting language. > > > > -- > > Daniel A. Morgan > > University of Washington > > damorgan@x.washington.edu > > (replace 'x' with 'u' to respond) > > |
| ||||
| Andy wrote: > Daniel and DB, > > Why don't you dynamically create the control file at runtime? For example: > > echo "LOAD DATA" > dyn_control.ctl > for datafile in `ls *.dat`; do > echo "INFILE $datafile" >> dyn_control.ctl > done > echo "INTO TABLE table1 ...." >> dyn_control.ctl > > Andy There is a demo of dynamically created control files at http://www.psoug.org Click on Morgan's Library Click on UTL_FILE. -- Daniel A. Morgan University of Washington damorgan@x.washington.edu (replace 'x' with 'u' to respond) |