iwan
iwan

Reputation: 7569

SQLLDR -- selective loading from pipe delimited txt

I am looking for a way to do selective loading using SQLLDR. The source file is in "pipe delimited" format.

I know there is a way for this if the source is in a predefined position. It is explained here, by using WHEN & POSITION keywords.

What could I do if the source file is "pipe or tab" delimited?

Upvotes: 1

Views: 10648

Answers (3)

Leela
Leela

Reputation: 1

LOAD DATA
INFILE 'c:\myfile.txt'  
TRUNCATE INTO TABLE T1
FIELDS TERMINATED BY '|' OPTIONALLY ENCLOSED BY '"'
TRAILING NULLCOLS (field1, field2 , field3, field4)

Upvotes: 0

Delvin
Delvin

Reputation: 1

Depending on which version of the SQLLDR version you are using, you can use the keyword FILLER to skip a field from the file.

The below instruction will skip the second field in the file.

LOAD DATA
TRUNCATE INTO TABLE T1
FIELDS TERMINATED BY ','
( field1,
  field2 FILLER,
  field3
)

Upvotes: 0

user330315
user330315

Reputation:

I am not sure what you mean with "selective loading"?

But ify you are only asking how you can load a file where each column is delimited with a pipe, then use the option FIELDS TERMINATED BY '|' in the control file.

See the chapter "Variable Record Format" in the SQL*Loader manual for more details and examples:
http://download.oracle.com/docs/cd/B19306_01/server.102/b14215/ldr_concepts.htm#sthref476

Upvotes: 2

Related Questions