Page 1 of 1

Cursor function in DS

Posted: Thu Jun 14, 2007 11:06 am
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,

Posted: Thu Jun 14, 2007 12:26 pm
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.

Posted: Thu Jun 14, 2007 3:28 pm
by ray.wurlod
You could execute a lookup based upon a correlated subquery. Ugly and slow, but it would work.