-
DBA's
I have the following problem:
I need to import a multi-record type tab delimited file
into a set of Oracle tables based on each record type.
If anyone has done something similar or has any idea how
do import this type of file I will appreciate the help.
The tab delimited file looks like :
101-1joesmith
101-2New Jersey
102-1PaulJones
102-2New York
101 is the employee number -1 and -2 are the record type indicators.
Record type 1 records are loaded into table
emp_names
(emp_num varchar(10),
fname varchar(20),
lname varchar(20))
Record type 2 records are loaded into table
emp_state
(emp_num varchar(10),
state varchar(20),
)
Thanks
Umesh
-
-
columns seperated by ...
'X09'
(or is it X'09'? I forget)
that works for me when I have tab delimited
If you cannot get the tab-delimited to load, sometimes I open the file (in word or textpad or whatever) and "replace" all the tabs with tildes (~) or something. That is easy to do as well.
- Magnus
-
Re: columns seperated by ...
Originally posted by jgmagnus
X'09'
is correct
Jeff Hunter
-
*phew*!
thanks for the confirmation.
good thing I caught my own mistake!
- Magnus
-
Re: *phew*!
Originally posted by jgmagnus
good thing I caught my own mistake!
If not, you know jmodic would be all over it like a hobo on a ham sandwich.
Jeff Hunter
-
Jurij Modic
ASCII a stupid question, get a stupid ANSI
24 hours in a day .... 24 beer in a case .... coincidence?
-
solution
Thanks DBA's
SQLLDR worked fine using the following syntax :
LOAD DATA
INFILE 'orderh.txt'
REPLACE
INTO TABLE order_rectype1
WHEN rec_type = '1'
(field1 terminated by x'09',
:
:
INTO TABLE order_rectype2
WHEN rec_type = '2'
(field1 terminated by x'09',
:
:
etc
Thanks
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|