?
Solved

sqlldr- combine and insert two values - position(1:10) and position(20:30)  into one column

Posted on 2012-04-03
2
Medium Priority
?
1,203 Views
Last Modified: 2012-04-03
i have to load a text file into oracle table using sqlldr.
I want to load characters from position(1:10) and position(20:30) into one column into my oracle table
I donot want to load characters from 10-20 since they are some invalid charactesr(like carriage returns etc) and it messes up my dataload of characters from position-20:30)
 
How can i do that using sqlldr
I tried
options( SKIP = 0 )
load data
infile 'myfile.txt' "str '\n'"
insert INTO
Table mytable
TRAILING NULLCOLS
 (  
allcols    position(1:10,20:30)  
 )

but that failed, I also tried using || concatenator but it did not work
pl help
0
Comment
Question by:at999
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 77

Accepted Solution

by:
slightwv (䄆 Netminder) earned 2000 total points
ID: 37803440
use boundfiller.

Here is a working example:

drop table tab1 purge;
create table tab1(col1 varchar2(10));

Open in new window


OPTIONS ( DIRECT=TRUE)
LOAD DATA
INFILE *
INTO TABLE TAB1
APPEND
FIELDS TERMINATED BY ','
(
part1 boundfiller position(1:3),
part2 boundfiller position(8:12),
col1  ":part1 || :part2"
)
begindata
abcdefghijklmnop

Open in new window

0
 

Author Closing Comment

by:at999
ID: 37803846
thanks a lot its working
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Why doesn't the Oracle optimizer use my index? Querying too much data Most Oracle developers know that an index is useful when you can use it to restrict your result set to a small number of the total rows in a table. So, the obvious side…
This post first appeared at Oracleinaction  (http://oracleinaction.com/undo-and-redo-in-oracle/)by Anju Garg (Myself). I  will demonstrate that undo for DML’s is stored both in undo tablespace and online redo logs. Then, we will analyze the reaso…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
This video explains what a user managed backup is and shows how to take one, providing a couple of simple example scripts.

719 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question