Home » SQL & PL/SQL » SQL & PL/SQL » from text file to ora.8i database
from text file to ora.8i database [message #18507] Sat, 02 February 2002 03:36 Go to next message
krahuman
Messages: 18
Registered: January 2002
Junior Member
hai ora.8i experts !

i need to load a oracle 8i database table
table_name(field1,field2,field3)

from a textfile which is the format of

text11 text21 text31
text21 text22 text23

how can i do ?
please explain me a bit detail about sql loader
as well

newcommer to oracle
Re: from text file to ora.8i database [message #18508 is a reply to message #18507] Sat, 02 February 2002 05:41 Go to previous messageGo to next message
Suresh Vemulapalli
Messages: 624
Registered: August 2000
Senior Member
use sqlloader to load data from text file to database tables.

1)write control file

2)invoke sqlloader

c:> sqlldr username/password@cstring control=control_file_name.ctl

see oracle utilities documentation for more details.
Re: from text file to ora.8i database [message #18523 is a reply to message #18507] Mon, 04 February 2002 06:34 Go to previous message
WFrederico
Messages: 4
Registered: February 2002
Junior Member
Here are two examples of load files that I depend on .. depending on whether the file format is fixed width or delimited -- Good Luck!

-------------------------------------------------------------------------------
--FIXED WIDTH LOAD EXAMPLE
-------------------------------------------------------------------------------
LOAD DATA
INFILE *
INTO TABLE srt (srt_id POSITION (01:11) NUMERIC EXTERNAL,
project POSITION (12:61) CHAR,
date_rec POSITION (62:80) DATE 'MM/DD/YYYY 0:00:00',
remedy_ojp_no POSITION (81:130) CHAR,
au_fema_ref_no POSITION (131:180) CHAR,
pr_no POSITION (181:230) CHAR,
requestor POSITION (231:280) CHAR,
estimate POSITION (281:330) CHAR,
status POSITION (331:380) CHAR,
priority POSITION (381:430) CHAR,
assigned_to POSITION (431:480) CHAR,
description POSITION (481:1480) CHAR,
comments POSITION (1481:2480) CHAR,
completion_date POSITION (2481:2494) DATE 'MM/DD/YYYY 0:00:00'
)
BEGINDATA

---------------------------------------------------------------------------------------
--DELIMITED FILE EXAMPLE
--------------------------------------------------------------------------------------
LOAD DATA INFILE * INTO TABLE srt FIELDS TERMINATED BY "," OPTIONALLY ENCLOSED BY '"'
TRAILING NULLCOLS ( srt_id,project,date_rec, remedy_ojp_no, au_fema_ref_no, pr_no,
requestor, estimate, status, priority, assigned_to, description, comments,
completion_date)
BEGINDATA
Previous Topic: Urgent plzz Help!
Next Topic: SQL*Plus Books for Beginners
Goto Forum:
  


Current Time: Thu Apr 25 21:43:28 CDT 2024