Computing.Net > Forums > Database > Inserting data from text file.

Inserting data from text file.

Reply to Message Icon

Original Message
Name: stewartt
Date: June 15, 2006 at 04:16:44 Pacific
Subject: Inserting data from text file.
OS: HP-UX
CPU/Ram: 1500mhz/12mb
Model/Manufacturer: HP
Comment:

Hi,
Maybe someone can give me advice , I am relatively new to Oracle and I need to load data from a text file into a database table. The format of the file and DB table is below so I would need an example script which would load the data.

Thanks in advance

=========================
smith:1044:233:2006-04-01
jones:1045:122:2005-02-04
Ford:1045:132:2006-04-23

========================
Table - Emp
Name
emp_no
dept_no
date


Report Offensive Message For Removal

Response Number 1
Name: lchi2000g
Date: July 17, 2006 at 12:50:03 Pacific
Subject: Inserting data from text file.
Reply: (edit)

http://download-west.oracle.com/docs/cd/B19306_01/server.102/b14215/ldr_concepts.htm#sthref478

Example 6-1 Loading Data in Fixed Record Format

load data
infile 'example.dat' "fix 11"
into table example
fields terminated by ',' optionally enclosed by '"'
(col1, col2)

example.dat:
001, cd, 0002,fghi,
00003,lmn,
1, "pqrs",
0005,uvwx,


Luke Chi


Report Offensive Follow Up For Removal







Use following form to reply to current message:

   Name: From My Computing.Net Settings
 E-Mail: From My Computing.Net Settings

Subject: Inserting data from text file.

Comments:

 


  Homepage URL (*): 
Homepage Title (*): 
         Image URL: 
 
Data Recovery Software