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

Home -> Community -> Usenet -> c.d.o.server -> Re: sqlload control file

Re: sqlload control file

From: <eldadea_at_mail.netvision.net.il>
Date: 1996/11/02
Message-ID: <NEWTNews.846895106.28811.eldadea@eldad-pc>#1/1

In Article<32792FFB.73F3_at_wink.com>, <marc.mangus_at_wink.com> writes:
> Path: news.NetVision.net.il!news-dc.gsl.net!news.gsl.net!news-stock.gsl.net!news.gsl.net!news-peer.gsl.net!news.gsl.net!www.nntp.primenet.com!nntp.primenet.com!news1.best.com!nntp1.best.com!usenet
> From: Marc Mangus <marc.mangus_at_wink.com>
> Newsgroups: comp.databases.oracle.server
> Subject: sqlload control file
> Date: Thu, 31 Oct 1996 15:02:19 -0800
> Organization: Wink Communications
> Lines: 7
> Message-ID: <32792FFB.73F3_at_wink.com>
> Reply-To: marc.mangus_at_wink.com
> NNTP-Posting-Host: entropy.wink.com
> Mime-Version: 1.0
> Content-Type: text/plain; charset=us-ascii
> Content-Transfer-Encoding: 7bit
> X-Mailer: Mozilla 3.0Gold (WinNT; I)
>
> Hi folks,
>
> I'm trying to load some text files into my OES 7.3.2 server running on
> Solaris 2.5.1. I've been beating my head against the desk trying to get
> the control file just right. The syntax is insane. Does anyone have
> any sample control files they can post? I've dealing with
> fixed-position ascii files. Thanks!

Hi

Look if it helps, for example
The Control File

  1. Position and length for each field are determined for each record, based on delimiters in the input file.
  2. WHT signifies that field LOC is terminated by WHITESPACE. The notation O(”) signifies optional enclosure by quotation marks.

In this case, the field positions and datatypes are specified explicitly. The control file is ULCASE2.CTL.

1) LOAD DATA
2) INFILE ’ulcase2.dat’
3) INTO TABLE emp
4) (empno POSITION(01:04) INTEGER EXTERNAL,
ename POSITION(06:15) CHAR,
job POSITION(17:25) CHAR,
mgr POSITION(27:30) INTEGER EXTERNAL,
sal POSITION(32:39) DECIMAL EXTERNAL,

comm POSITION(41:48) DECIMAL EXTERNAL,
5) deptno POSITION(50:51) INTEGER EXTERNAL) Notes:
1) The LOAD DATA statement is required at the beginning of the control file.
2) The name of the file containing data follows the keyword INFILE.
3) The INTO TABLE statement is required to identify the table to be loaded 
into.
4) Lines 4 and 5 identify a column name and the location of the data in the datafile to be loaded into that column. EMPNO, ENAME, JOB, and so on are names of columns in table EMP. The datatypes (INTEGER EXTERNAL, CHAR, DECIMAL EXTERNAL) identify the datatype of data fields in the file, not of corresponding columns in the EMP table.
5) Note that the set of column specifications is enclosed in parentheses. Eldad Received on Sat Nov 02 1996 - 00:00:00 CST

Original text of this message

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