Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> Re: How to load text file into database table

Re: How to load text file into database table

From: <Chaim.Katz_at_Completions.Bombardier.com>
Date: Fri, 20 Sep 2002 12:14:35 -0800
Message-ID: <F001.004D585F.20020920121435@fatcity.com>

David,
I don't know sqlldr that well, but a possible quick and dirty solution - is to load the text file into a one column oracle table, and then in a subsequent step, use SQL to move the data to the proper columns of the proper Oracle table. The ctl file from the first step would be something like this:
1)
LOAD DATA
INFILE useraccnt.txt
APPEND
concatentate 7
INTO TABLE temp
(txt char(2000)

)

In the second step you could use a bunch of substr and instr to find the column data, or use PL/SQL to loop through the text , or you could use a function in the owa_pattern package

Chaim

"Nguyen, David M" <david.m.nguyen_at_xo.com>@fatcity.com on 09/20/2002 11:53:29 AM

Please respond to ORACLE-L_at_fatcity.com

Sent by: root_at_fatcity.com

To: Multiple recipients of list ORACLE-L <ORACLE-L_at_fatcity.com> cc:

I have a text file and need to load it into database table using sqlldr utility. Is there a way to load a text file? I know how to load csv file but not text file.

Date: Wed Aug 29 10:43:53 CDT 2001
Name: Paris By Night
Email: xyz_at_testing.com
Phone: 202-333-4444
Location: Washington, DC
Equipment needing to access: EMS, , , , , Reason: Not working

I want to above data into useraccount table which has following columns.

date
username
email
phone
location
equipment
reason

Thanks in advance,
David

--
Please see the official ORACLE-L FAQ: http://www.orafaq.com
--
Author: Nguyen, David M
  INET: david.m.nguyen_at_xo.com

Fat City Network Services    -- 858-538-5051 http://www.fatcity.com
San Diego, California        -- Mailing list and web hosting services
---------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L

(or the name of mailing list you want to be removed from). You may
also send the HELP command for other information (like subscribing). -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: INET: Chaim.Katz_at_Completions.Bombardier.com Fat City Network Services -- 858-538-5051 http://www.fatcity.com San Diego, California -- Mailing list and web hosting services --------------------------------------------------------------------- To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from). You may
also send the HELP command for other information (like subscribing).
Received on Fri Sep 20 2002 - 15:14:35 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US