data conversion problem

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

hemaarvind1
Participant
Posts: 50
Joined: Mon Jan 21, 2008 9:35 am

data conversion problem

Post by hemaarvind1 »

Hi,

I am having data as follows in the sequential file which is the source.

"39368,39399,39429","TEY/MTH10/2007","2007 October - 2007 December"

The source file is a comma separated file (CSV file). I have to load this data to an oracle table.

I could not load this to the oracle table as I am getting problem with the first field

"39368,39399,39429"

I tried specifying the datatype as number and varchar,but invain.

could someone please suggest me a way to load this data.
ETLJOB
Participant
Posts: 87
Joined: Thu May 01, 2008 1:15 pm
Location: INDIA

Post by ETLJOB »

"39368,39399,39429"

Is the above value is treated as three different columns by DataStage? I hope you have comma as delimiter.
hemaarvind1
Participant
Posts: 50
Joined: Mon Jan 21, 2008 9:35 am

Post by hemaarvind1 »

Yes, comma is the delimiter used . It returned an oracle error :

ORA-01722: invalid number

I am not sure if it is due to comma. please confirm.
ETLJOB
Participant
Posts: 87
Joined: Thu May 01, 2008 1:15 pm
Location: INDIA

Re: data conversion problem

Post by ETLJOB »

hemaarvind1 wrote: I tried specifying the datatype as number and varchar,but invain.
Did you try the above in Source or in target?

Is your view data option showing right data as expected?
syeed
Participant
Posts: 19
Joined: Fri Jan 19, 2007 12:35 am
Location: bangalore

Post by syeed »

Since you have enclosed with in double quotes and assuming you have done this setting in your Seq file as well (i.e. anything enclosed with in double quotes as a one column value).

Now you can read the first column as a varchar and remove any comma's and load the data into the oracle object.

thanks!
Syed
---------
Wait and Watch
hemaarvind1
Participant
Posts: 50
Joined: Mon Jan 21, 2008 9:35 am

Post by hemaarvind1 »

I am using the sequential file at the source level.

I could not remove the commas in between the data as it is part of the data. I have to load the data as it is .
Sainath.Srinivasan
Participant
Posts: 3337
Joined: Mon Jan 17, 2005 4:49 am
Location: United Kingdom

Post by Sainath.Srinivasan »

Did you specify that the fields are quoted ?
Sainath.Srinivasan
Participant
Posts: 3337
Joined: Mon Jan 17, 2005 4:49 am
Location: United Kingdom

Post by Sainath.Srinivasan »

Did you specify that the fields are quoted ?
daramanoj
Participant
Posts: 20
Joined: Wed Jul 29, 2009 4:01 am

Post by daramanoj »

Hi

Change the delimiter to | then you can actually insert all the data you want
Thanks ,

Manoj
hemaarvind1
Participant
Posts: 50
Joined: Mon Jan 21, 2008 9:35 am

Post by hemaarvind1 »

Hi Sainath,

Yes I have specified that the fields are quoted.
hemaarvind1
Participant
Posts: 50
Joined: Mon Jan 21, 2008 9:35 am

Post by hemaarvind1 »

Hi Manoj,

the problem is I cannot change the files as these are sent by the client. hence I could not change the delimiter.

please suggest if I can let the client know that I cannot load the data if it is in the current format due to comma present in the data.
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Re: data conversion problem

Post by ArndW »

hemaarvind1 wrote:...
"39368,39399,39429","TEY/MTH10/2007","2007 October - 2007 December"
If "," is your separator then the first column will be read as a string regardless of whether or not you specify a quote character and you cannot load that value into a numeric field.

Or is the data supposed to be 3 numeric fields then 2 more fields?
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

However it is a perfectly valid varchar so unclear why that would have been "in vain". What is the data type in Oracle of the target field for that value? :?
-craig

"You can never have too many knives" -- Logan Nine Fingers
hemaarvind1
Participant
Posts: 50
Joined: Mon Jan 21, 2008 9:35 am

Post by hemaarvind1 »

The datatype in oracle is supposed to be a number. However, I tried with using datatype as varchar also. For either number or varchar, it is giving the same error.
hemaarvind1
Participant
Posts: 50
Joined: Mon Jan 21, 2008 9:35 am

Post by hemaarvind1 »

"39368,39399,39429" data is supposed to be falling in a single field.
Post Reply