Fixed width file

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

Post Reply
krisna
Participant
Posts: 77
Joined: Tue Apr 08, 2008 11:33 pm

Fixed width file

Post by krisna »

my project requirement is like this

I have a fixed width file. Now data has to be tranferred from fixed width file to oracle. to achive this Iam using

Sequential file --> Transformer --> oracle enterprise

sample data

+320+20070301+01+00012+00000000+00000000+00001
+319+20070401+01+00012+00000000+00000000+00001
+318+20070301+01+00012+00000000+00000000+00001

in transformer Iam using
field(DSlink1.field[1,4],"+",2)
field(DSlink1.field[5,9],"+",2)
and so on.

Iam using 'field' for removing '+'
In oracle stage I used write method as upsert.

Problem is when I run the job,
ex :
I have 10 records
for first run 10 records are loaded. So total records are 10 now.
for second run again 10 records are loaded (old data only). So total records are 20 now.

but actually it should be only 10 records. I mean to say insertion is happening but not the update.

Note :- Bold column data is of date datatype.

Please provide me the solution ASAP
keshav0307
Premium Member
Premium Member
Posts: 783
Joined: Mon Jan 16, 2006 10:17 pm
Location: Sydney, Australia

Post by keshav0307 »

what is your update query?

do you have unique index on the key columns you may have checked the oracle stage unput coulmns?
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

What is your upsert setting?

Create a reject link from the Oracle Enterprise stage.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
krisna
Participant
Posts: 77
Joined: Tue Apr 08, 2008 11:33 pm

Post by krisna »

I don't have any key columns, normal update
krisna
Participant
Posts: 77
Joined: Tue Apr 08, 2008 11:33 pm

Post by krisna »

Hi,

write method = upsert
upsert order = insert then update
upsert mode = user defined update and insert


if I use upsert order as 'update then insert' its throwing an error that

'cannot recognize - update first'

thanks
keshav0307
Premium Member
Premium Member
Posts: 783
Joined: Mon Jan 16, 2006 10:17 pm
Location: Sydney, Australia

Post by keshav0307 »

you must have key columns for upsert

read parallel job advanced developers guide page 27 "Oracle Database Tips"
krisna
Participant
Posts: 77
Joined: Tue Apr 08, 2008 11:33 pm

Post by krisna »

The above mentioned solutions are not working. Please give the solution
AmeyJoshi14
Participant
Posts: 334
Joined: Fri Dec 01, 2006 5:17 am
Location: Texas

Post by AmeyJoshi14 »

Hi,
can you please paste the INSERT and UPDATE queries which you are using in the job...along with sample records..which are insert into the table...
http://findingjobsindatastage.blogspot.com/
Theory is when you know all and nothing works. Practice is when all works and nobody knows why. In this case we have put together theory and practice: nothing works. and nobody knows why! (Albert Einstein)
keshav0307
Premium Member
Premium Member
Posts: 783
Joined: Mon Jan 16, 2006 10:17 pm
Location: Sydney, Australia

Post by keshav0307 »

The above mentioned solutions are not working. Please give the solution
i am sorry but this is wrong statement.

probably you have not implemented it properly. this is solution because it works.
Post Reply