30: select max(wo1.operation_seq_num),
31: min(wo2.operation_seq_num)
32: into x_prev_op_seq_num,
33: x_next_op_seq_num
34: from dual sd,
35: wip_operations wo1,
36: wip_operations wo2
37: where wo1.organization_id(+) = p_org_id
38: and wo1.wip_entity_id(+) = decode(1, 1, p_wip_entity_id, sd.dummy)