constraint confusing

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
scottr
Participant
Posts: 51
Joined: Thu Dec 02, 2004 11:20 am

constraint confusing

Post by scottr »

Hi,
my previous developer uses the following constraits in the xfm which is confusing me ..pl help me to understand this .
the the following two links.none of them are rejected..

link constraint
fromfilter ('I'=toFilter.UPDT_TXN_TYPE_CD) or ('D'=toFilter.UPDT_TXN_TYPE_CD)

todelete ('D'=toFilter.UPDT_TXN_TYPE_CD)

thanks
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

No rows will be rejected if toFilter.UPDT_TXN_TYPE_CD is "D" for every row.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Sainath.Srinivasan
Participant
Posts: 3337
Joined: Mon Jan 17, 2005 4:49 am
Location: United Kingdom

Post by Sainath.Srinivasan »

The 'fromfilter' is a superset of 'todelete'. Hence any row going to 'todelete' will be true in 'fromfilter'.

Can you tell us where the reject comes in picture?
scottr
Participant
Posts: 51
Joined: Thu Dec 02, 2004 11:20 am

Post by scottr »

the values of toFilter.UPDT_TXN_TYPE_CD are either I or D
as you said if the value of toFilter.UPDT_TXN_TYPE_CD = D then the rows has to go to the link todelete, but couple of rows with D are showed up at the next xfm(fromfilter link) and here his is deleting records from the table if the value is D
ketfos
Participant
Posts: 562
Joined: Mon May 03, 2004 8:58 pm
Location: san francisco
Contact:

Post by ketfos »

Hi,

this is expected.
because fromfilter has filter condtion

'I'=toFilter.UPDT_TXN_TYPE_CD) or ('D'=toFilter.UPDT_TXN_TYPE_CD)


i.e value with D or I.

Ketfos
scottr
Participant
Posts: 51
Joined: Thu Dec 02, 2004 11:20 am

Post by scottr »

that's right but the second link "todelete" has 'D'=toFilter.UPDT_TXN_TYPE_CD. so does it means all rows with D should go to this link?
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Yes. "I" or "D" goes down the first link, only "D" goes down the second. In other words, an "I" goes down the first link and a "D" goes down both.

Interesting they were written what would generally be considered to be 'backwards'... but either direction gets you the same results. :wink:
-craig

"You can never have too many knives" -- Logan Nine Fingers
Sainath.Srinivasan
Participant
Posts: 3337
Joined: Mon Jan 17, 2005 4:49 am
Location: United Kingdom

Post by Sainath.Srinivasan »

Did you check whether you have some column metadata has 'No' to 'Null Allowed' as this will make those records disappear from the link for failing this constraint.
Post Reply