Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Import data from TXT 1

Status
Not open for further replies.

NiteCrawlr

Programmer
Mar 16, 2001
140
BR
Hi,
I need some help in importing data from a txt, how can I do this?
the data in the txt looks like this:

21/06/2001;11:01:36;Acesso;Login;901;0;10;MGB;0;

everything is separated by ";"

Thanks

Frederico
 
I would take a look at SQL*Loader. You will have to have a table and then build a control (.CTL) file. It's kind of a pain to get the control file set up, but after that, it works like a charm. You can also have some functions in the control file if you need to do any formatting of the data to be imported. Terry M. Hoey
th3856@txmail.sbc.com
While I don't mind e-mail messages, please post all questions in these forums for the benefit of all members.
 
Hi there ,
Please try using SQLLOADER utility . Its for these purposes only .

Hope it helps ,
Udit.
 
I'm sorry to bother you people... :)

but I'm sjust starting to work with oracle.
I have the Oracle 8.0.5, is the SQL Loader installed with this version? How does it works?

Thank you

Frederico
 
Yes, SQL Loader is a standard utility that comes with all versions of Oracle. If you have access to the Oracle utilities manual, you will find documentation there.

To get you started, the loader can be invoked from any O/S prompt. The command would be something like

sqlldr80 username/password control={control file name}

The file name specified by "control=" contains statements that reflect the format of your data file. An example that's probably fairly close to what you need is

load data
infile `input file name' "var"
badfile `bad file name'
discardfile `discard file name'
discardmax 99999
truncate
into table your_table
fields terminated by ";"
(col1, col2, col3, col4, col5, col6, col7, col8, col9)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top