Solved

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

Posted on 2012-04-03
2
910 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
2 Comments
 
LVL 76

Accepted Solution

by:
slightwv (䄆 Netminder) earned 500 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Oracle and DateTime math 6 26
Converting a row into a column 2 44
Oracle query output question 4 36
help on oracle query 5 33
I remember the day when someone asked me to create a user for an application developement. The user should be able to create views and materialized views and, so, I used the following syntax: (CODE) This way, I guessed, I would ensure that use…
From implementing a password expiration date, to datatype conversions and file export options, these are some useful settings I've found in Jasper Server.
This video shows setup options and the basic steps and syntax for duplicating (cloning) a database from one instance to another. Examples are given for duplicating to the same machine and to different machines
This video shows how to copy an entire tablespace from one database to another database using Transportable Tablespace functionality.

920 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now