Whatz the use of '?' symbol in a DRS lookup .......

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
Shri
Participant
Posts: 10
Joined: Fri Nov 19, 2004 2:21 pm

Whatz the use of '?' symbol in a DRS lookup .......

Post by Shri »

Hi all,

I have a logic like <> symbols are used in the lookup condition, how to do a relational lookup. Someone said that, we need to use '?' symbols in the drs lookup.. i cnt understand the logic of '?' symbol in the sql query, also, in some place it was like :1 :2, what this number mentions like it was,


select count(name),empno from emp where name=:1 and emp=:2 and start_date> ? and end_date< ? group by empno.


Whatz this query says with the :1 and :2, and what the '?' symbol says here. please anyone can explain me about this. how can they get the count value in the job, and how will be the column derivation tab will appear....


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

Post by ray.wurlod »

The AND part of the WHERE clause and the GROUP BY clause have been entered manually on the Selection tab. T

he parameter markers in the first part of the WHERE clause have been generated by the DRS because these are key columns and you're performing a reference lookup.

For whatever reason, DRS uses the Oracle notation for parameter markers (:1, :2 and so on) despite the fact that no other database does so :roll: , and irrespective of the DB type setting.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
ketfos
Participant
Posts: 562
Joined: Mon May 03, 2004 8:58 pm
Location: san francisco
Contact:

Post by ketfos »

Hi,
What are your requirements. Please elaborate clearly you you need to achieve?

Ketfos
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

ray.wurlod wrote:For whatever reason, DRS uses the Oracle notation for parameter markers (:1, :2 and so on) despite the fact that no other database does so
I don't know about other folks, but I vastly prefer the Oracle numbered parameter marker style over the other 'question mark' way of handling them. :?
-craig

"You can never have too many knives" -- Logan Nine Fingers
Shri
Participant
Posts: 10
Joined: Fri Nov 19, 2004 2:21 pm

How to implement the relational lookup instead of equi look

Post by Shri »

I have 3 source driver tables..
emp A
person B
dept C the join condition which i give in the DRS source is as follows,

WHERE B.EMPID=A.EMPID AND C.CTLVALUE=A.BUNIT AND C.RNAME='PER' ORDER BY A.BSC,B.OID

But for a target column the transformation logic is, assume the column name is Num_of_Person, It was said that the below table and logic should be used to get the value for the target field Num_of_Person,

emp A2
person B2
dept C2

Num_of_Person =
COUNT (WHERE A2.BUNIT=A.BUNIT
AND A2.BSC=A.BSC
AND A2.SDate=A.SDate
AND B2.EMPID=A2.EMPID
AND C2.CTLVALUE=A2.BUNIT
AND C2.RNAME='PER'
AND B2.OID <=B.OID)


i want to implement this logic with out an Aggregate transformer.... i need to do this using a DRS stage as a lookup. am using SQL server, but the script which i use should be database independent.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

ray.wurlod wrote:For whatever reason, DRS uses the Oracle notation for parameter markers (:1, :2 and so on) despite the fact that no other database does so :roll:
Surely, if democracy is such a wunnerfull thang (as Dubbya keeps telling us), we should go with the majority vote ("?" as parameter markers in this case). Indeed, under current policy ought we not to launch pre-emptive strikes against Oracle bin Larry and all his followers until they are crushed into true belief, and using "?" for parameter markers like the rest of the free world (see footnote).

In case anyone hasn't figured it out yet, the above is an attempt at humour. I especially liked "Oracle bin Larry".

Footnote: Only for some particular value of "free".
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Shri
Participant
Posts: 10
Joined: Fri Nov 19, 2004 2:21 pm

How to do the relational logics inlookup.......

Post by Shri »

Usually we will do equi lookup,, if my lookup is based on '<' or '>', how to implement the lookup condition. Am using the DRS stage as my lookup stage. please can anyone update me regarding this. I gave the logic too, in the previous post of this post.
Post Reply