I have a BIRT report with a data set using the following query
select id, parentId from objectTable where id=?
The id used in the query is passed in through a BIRT parameter and based on the results I get I want to find the parentObject. After the above query is executed I want to check if a parentObject exists and do this by checking the parentId value from the query above and if it's not zero there is a parent object. So somehow I need to say
while (parentId > 0)
select id, parentId from objectTable where id=parentId
Then I need to continue looping until the parentId is zero and I know I have the greatest ancestor.
Is there a way to use Javascript on the dataset to do this? or possibly a nested sql statement that will allow me to do something like this?