Trimming issue with ORABULK

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
mujeebur
Participant
Posts: 46
Joined: Sun Mar 06, 2005 3:02 pm
Location: Philly,USA

Trimming issue with ORABULK

Post by mujeebur »

Hope this issue somebody encountered.

When I generating the datafile with ORABULK stage , the traling spaces in the input string will be taken off. May I have any explanation on this ?

eg:
Input File Data
-------------------
sno, name
1,"Pennsylvania "
2,"New Jersey "

Output File Data ( datafile generated from ORABULK)
sno, name
1,"Pennsylvania"
2,"New Jersey"
I_Server_Whale
Premium Member
Premium Member
Posts: 1255
Joined: Wed Feb 02, 2005 11:54 am
Location: United States of America

Post by I_Server_Whale »

Hi,

What is your input file format? I can see it is a comma delimited-file. Does it have any quote character??

How are you reading this file? What transformations are you putting it through?

Input Data given by you:

Code: Select all


eg: 
Input File Data 
------------------- 
sno, name 
1,"Pennsylvania " 
2,"New Jersey "

Is it exactly like the above or is it like:

Code: Select all


Input File Data 
------------------- 
sno, name 
"1","Pennsylvania " 
"2","New Jersey "

That would help us better understand the problem.

Thanks,
Naveen.
Anything that won't sell, I don't want to invent. Its sale is proof of utility, and utility is success.
Author: Thomas A. Edison 1847-1931, American Inventor, Entrepreneur, Founder of GE
rleishman
Premium Member
Premium Member
Posts: 252
Joined: Mon Sep 19, 2005 10:28 pm
Location: Melbourne, Australia
Contact:

Post by rleishman »

I would use a SEQ file stage to dump data to a file rather than the Oracle BULK loader. My reasoning here.
Ross Leishman
mujeebur
Participant
Posts: 46
Joined: Sun Mar 06, 2005 3:02 pm
Location: Philly,USA

Post by mujeebur »

My question is : The trailing spaces are truncating on the character variable's data.

eg: "Pennsylvania @@@@" is writing to datafile from ORABULK
as "Pennsylvania" ( where @=space )
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

That's normal behaviour for the Oracle bulk loader. You need to use the 'PRESERVE BLANKS' clause if you want them retained.
-craig

"You can never have too many knives" -- Logan Nine Fingers
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

It's not available in Server. We've had to script changes into the .ctl file 'on the fly' before the actual load using 'sed' to handle things like that. :cry:

Or let it generate a .ctl file and then use your own (static) pre-edited one during the load.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply