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: DENNIS WILLIAMS <DWILLIAMS_at_LIFETOUCH.COM>
Date: Fri, 20 Sep 2002 12:05:43 -0800
Message-ID: <F001.004D5819.20020920120543@fatcity.com>


Viral - I'm glad that someone a lot more familiar than I with SQL*Loader replied, and hopefully that will handle David's problem. I'm just curious about one thing, having encountered this sort of thing before. Can SQL*Loader handle the situation where some lines may not be present? For example, suppose the REASON line is sometimes two or three lines. When I've had situations like this, I've often seen a variable number of lines. That is why I suggested Perl, which can easily handle this sort of thing. Of course, Perl is so handy that I think every DBA should learn it, for tasks just like this.

 
Dennis Williams
DBA
Lifetouch, Inc.
dwilliams_at_lifetouch.com <mailto:dwilliams_at_lifetouch.com>

-----Original Message-----
Sent: Friday, September 20, 2002 2:44 PM To: Multiple recipients of list ORACLE-L

Oracle sql*loader has many many features...at two of them are applicable in your specific case.

You could use CONCATENATE or CONTINUEIF clauses of control file. These clauses help you wherever you have multiple physical records form one logical record.

Cheers
Viral Desai.

>From: DENNIS WILLIAMS <DWILLIAMS_at_LIFETOUCH.COM>
>Reply-To: ORACLE-L_at_fatcity.com
>To: Multiple recipients of list ORACLE-L <ORACLE-L_at_fatcity.com>
>Subject: RE: How to load text file into database table
>Date: Fri, 20 Sep 2002 08:53:34 -0800
>
>David - If the file is in just the format you show, my first impulse would
>be to use the perl script language to get it into a form that sqlldr could
>easily read. Perl is available on all platforms, including Windows. If you
>get ambitious, Perl can even directly insert the values into Oracle. Jared
>Still, the manager of this list has just published a book on that aspect.
>
>http://search.barnesandnoble.com/booksearch/isbnInquiry.asp?userid=0E2CIPD0
W
>9&isbn=0596002106
>

>Dennis Williams
>DBA
>Lifetouch, Inc.
>dwilliams_at_lifetouch.com <mailto:dwilliams_at_lifetouch.com>
>
>
>-----Original Message-----
>Sent: Friday, September 20, 2002 10:54 AM
>To: Multiple recipients of list ORACLE-L
>
>
>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.
>
>*** Below is text file format.
>
>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: DENNIS WILLIAMS
> INET: DWILLIAMS_at_LIFETOUCH.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).



MSN Photos is the easiest way to share and print your photos: http://photos.msn.com/support/worldwide.aspx
-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: Viral Desai
  INET: viral303_at_hotmail.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: DENNIS WILLIAMS
  INET: DWILLIAMS_at_LIFETOUCH.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:05:43 CDT

Original text of this message

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