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

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Inserting data from text file.

Reply to Message Icon

Name: stewartt
Date: June 15, 2006 at 04:16:44 Pacific
OS: HP-UX
CPU/Ram: 1500mhz/12mb
Product: 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



Sponsored Link
Ads by Google

Response Number 1
Name: lchi2000g
Date: July 17, 2006 at 12:50:03 Pacific
Reply:

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


0
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Database Forum Home


Sponsored links

Ads by Google


Results for: Inserting data from text file.

write into text file using spool www.computing.net/answers/dbase/write-into-text-file-using-spool-/136.html

Using sqlldr to insert blob? www.computing.net/answers/dbase/using-sqlldr-to-insert-blob/179.html

import multiple text files into access www.computing.net/answers/dbase/import-multiple-text-files-into-access/715.html