CassidyHunt
IS-IT--Management
Is there a way to combine the information from two cursors to make one cursor?
For example: (I know this could be accomplished with a single select but I have cases more complex that would be nice to do this)
I have been playing around with table types and fetch but they just don't seem to do the trick. So I am thinking I am going to have to come up with a cursor type. The reason for why I want to do this is that my end result is to have a store proc that will produce a single resultset of the combined cursor.
I am greatful for any help. This is has been an incrediable resource for me.
Cassidy
For example: (I know this could be accomplished with a single select but I have cases more complex that would be nice to do this)
Code:
cursor cur_op is
Select o.sequence_no, o.resource_id
from operation o
where o.workorder_type = 'W'
and o.workorder_base_id = 'Q05458'
and o.workorder_lot_id = '1'
and o.workorder_split_id = '0'
and o.workorder_sub_id = '0';
cursor cur_op_cost is
Select o.run_hrs, o.run_cost_per_hr, o.bur_per_hr_run
from operation o
where o.workorder_type = 'W'
and o.workorder_base_id = 'Q05458'
and o.workorder_lot_id = '1'
and o.workorder_split_id = '0'
and o.workorder_sub_id = '0';
being
'Some code to turn two cursors into one
'prt(information)
end;
I have been playing around with table types and fetch but they just don't seem to do the trick. So I am thinking I am going to have to come up with a cursor type. The reason for why I want to do this is that my end result is to have a store proc that will produce a single resultset of the combined cursor.
I am greatful for any help. This is has been an incrediable resource for me.
Cassidy