454: begin
455:
456: -- loop until unique key is generated
457: while (v_count > 0) loop
458: select MSD_SR_LEVEL_PK_S.nextval
459: into v_ret
460: from sys.dual;
461:
462: select count(*)
485:
486: -- loop until unique key is generated from staging and fact table
487: while ( v_count1 > 0 OR v_count2 > 0) loop
488:
489: select MSD_SR_LEVEL_PK_S.nextval
490: into v_next
491: from sys.dual;
492:
493: select count(*)