Cursor function in DS

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
boligoma
Premium Member
Premium Member
Posts: 24
Joined: Tue Apr 24, 2007 3:07 pm

Cursor function in DS

Post by boligoma »

Hi,

I want to search for previous rows in a table and make comparisons between them, can I do it in DS???

To explain it better, I have this table:

date, executive, account, value

I need to know if any of the values from one year behind the date in the row is above 1000. I know I can get it around using a Store Procedure with a cursor, but I cannot use external functions.

My DB is in oracle 9.1.

Thanks,
Ismael Martinez
Intellego SC
www.grupointellego.com
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

You can use stage variables to hold previous rows values and do your manipulation there. Search the forum on the 'How to' part. Search on keywords like row comparison.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

You could execute a lookup based upon a correlated subquery. Ugly and slow, but it would work.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply