563: DECLARE
564: INV_VIEW_DOES_NOT_EXIST EXCEPTION;
565: PRAGMA EXCEPTION_INIT(INV_VIEW_DOES_NOT_EXIST, -00942);
566: BEGIN
567: cur := DBMS_SQL.Open_Cursor;
568: --
569: hr_utility.set_location(l_proc||': Before parse', 30);
570: --
571: DBMS_SQL.Parse (cur,
567: cur := DBMS_SQL.Open_Cursor;
568: --
569: hr_utility.set_location(l_proc||': Before parse', 30);
570: --
571: DBMS_SQL.Parse (cur,
572: ' SELECT NULL
573: FROM INV_ORGANIZATION_NAME_V
574: WHERE organization_id = :pOrgId', DBMS_SQL.Native );
575: DBMS_SQL.Bind_Variable (cur, 'pOrgId',p_inventory_organization_id );
570: --
571: DBMS_SQL.Parse (cur,
572: ' SELECT NULL
573: FROM INV_ORGANIZATION_NAME_V
574: WHERE organization_id = :pOrgId', DBMS_SQL.Native );
575: DBMS_SQL.Bind_Variable (cur, 'pOrgId',p_inventory_organization_id );
576: hr_utility.set_location(l_proc||': Before Execute', 40);
577: res := DBMS_SQL.Execute(cur);
578:
571: DBMS_SQL.Parse (cur,
572: ' SELECT NULL
573: FROM INV_ORGANIZATION_NAME_V
574: WHERE organization_id = :pOrgId', DBMS_SQL.Native );
575: DBMS_SQL.Bind_Variable (cur, 'pOrgId',p_inventory_organization_id );
576: hr_utility.set_location(l_proc||': Before Execute', 40);
577: res := DBMS_SQL.Execute(cur);
578:
579: -- Make sure we have a valid inventory organization
573: FROM INV_ORGANIZATION_NAME_V
574: WHERE organization_id = :pOrgId', DBMS_SQL.Native );
575: DBMS_SQL.Bind_Variable (cur, 'pOrgId',p_inventory_organization_id );
576: hr_utility.set_location(l_proc||': Before Execute', 40);
577: res := DBMS_SQL.Execute(cur);
578:
579: -- Make sure we have a valid inventory organization
580: hr_utility.set_location(l_proc||': Before Fetch', 50);
581: If (DBMS_SQL.FETCH_ROWS (cur) = 0) then
577: res := DBMS_SQL.Execute(cur);
578:
579: -- Make sure we have a valid inventory organization
580: hr_utility.set_location(l_proc||': Before Fetch', 50);
581: If (DBMS_SQL.FETCH_ROWS (cur) = 0) then
582: hr_utility.set_location(l_proc||': Rasing Error', 60);
583: hr_utility.set_message(800, 'PER_52503_INV_INVENT_ORG_ID');
584: hr_utility.raise_error;
585: End if;
584: hr_utility.raise_error;
585: End if;
586:
587: hr_utility.set_location(l_proc||': Before close cursor', 70);
588: DBMS_SQL.Close_Cursor (cur);
589: EXCEPTION
590: When INV_VIEW_DOES_NOT_EXIST Then
591: hr_utility.set_location(l_proc||': View INV_ORGANIZATION_NAME_V not found', 99);
592: if DBMS_SQL.Is_Open(cur) then
588: DBMS_SQL.Close_Cursor (cur);
589: EXCEPTION
590: When INV_VIEW_DOES_NOT_EXIST Then
591: hr_utility.set_location(l_proc||': View INV_ORGANIZATION_NAME_V not found', 99);
592: if DBMS_SQL.Is_Open(cur) then
593: DBMS_SQL.Close_Cursor(cur);
594: end if;
595:
596: When Others then
589: EXCEPTION
590: When INV_VIEW_DOES_NOT_EXIST Then
591: hr_utility.set_location(l_proc||': View INV_ORGANIZATION_NAME_V not found', 99);
592: if DBMS_SQL.Is_Open(cur) then
593: DBMS_SQL.Close_Cursor(cur);
594: end if;
595:
596: When Others then
597: hr_utility.set_location(l_proc||': Other Error found'||sqlerrm, 99);
594: end if;
595:
596: When Others then
597: hr_utility.set_location(l_proc||': Other Error found'||sqlerrm, 99);
598: if DBMS_SQL.Is_Open(cur) then
599: DBMS_SQL.Close_Cursor(cur);
600: end if;
601: raise;
602: END;
595:
596: When Others then
597: hr_utility.set_location(l_proc||': Other Error found'||sqlerrm, 99);
598: if DBMS_SQL.Is_Open(cur) then
599: DBMS_SQL.Close_Cursor(cur);
600: end if;
601: raise;
602: END;
603: