cursor 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
asaf_arbely
Premium Member
Premium Member
Posts: 87
Joined: Sat Jul 14, 2007 2:24 pm

cursor lookup

Post by asaf_arbely »

Hi
We need to perform a cursor lookup in order to find more than one row in the reference link
Our job design is a source from oracle table from one DB and another oracle table in the reference link.
Any ideas?
Sainath.Srinivasan
Participant
Posts: 3337
Joined: Mon Jan 17, 2005 4:49 am
Location: United Kingdom

Post by Sainath.Srinivasan »

Use 'returns multiple rows' options.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Unless something has changed in 8.x the only Server stages that support multiple row returns from reference lookups are the ODBC and UV stages.
-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 »

Doh!! Me and my PX !!

In server, depending on volume, you can
1.) Use ODBC link
2.) Create db link
3.) Use hash file with combined rows
4.) Simulate multiple rows from rows so each with gather one reference row.

There are other methods also. Need more information on what you are attempting, volume, match possibility etc.
asaf_arbely
Premium Member
Premium Member
Posts: 87
Joined: Sat Jul 14, 2007 2:24 pm

Post by asaf_arbely »

Can you collaborate more on "3.) Use hash file with combined rows"?
My source is about 100k records and my reference is about 10 million
The match possibility is 0-n
thank's
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

That would be where the UV stage comes in. You can use one to access a hashed file as long as the hashed file was created in an account or you manually create a VOC record for it.

After that, it's a matter of creating the hashed files with enough keys to ensure all records get loaded and then using fewer keys to do the reference lookup in the UV stage so that there are multiples to return per 'key'. In either case you need to enable the option on the Link Properties page of the reference lookup.

The technique has been discussed here quite a bit.
-craig

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