[Home] [Help]
168: end if;
169:
170: select resource_over_util_cost
171: into v_resource_over_util_cost
172: from msc_department_resources
173: where department_id = arg_department_id
174: and resource_id = arg_resource_id
175: and organization_id = arg_org_id
176: and sr_instance_id = arg_instance_id
656: elsif arg_org_id is null then
657:
658: select distinct department_code
659: into v_department_code
660: from msc_department_resources
661: where department_id = arg_dept_id
662: and plan_id = arg_plan_id
663: and sr_instance_id = arg_instance_id
664: and line_flag = arg_line_flag;
666: else
667:
668: select distinct department_code
669: into v_department_code
670: from msc_department_resources
671: where department_id = arg_dept_id
672: and plan_id = arg_plan_id
673: and organization_id = arg_org_id
674: and sr_instance_id = arg_instance_id
691:
692: if arg_dept_id = -1 then -- from undo, arg_org_id will pass transaction_id
693: select mdr.resource_code
694: into v_resource_code
695: from msc_department_resources mdr,
696: msc_resource_requirements mrr
697: where mdr.department_id = mrr.department_id
698: and mdr.resource_id = arg_resource_id
699: and mdr.plan_id = mrr.plan_id
715: else
716:
717: select resource_code
718: into v_resource_code
719: from msc_department_resources
720: where department_id = arg_dept_id
721: and resource_id = arg_resource_id
722: and plan_id = arg_plan_id
723: and organization_id = arg_org_id
744: return util_pct;
745: else
746: select utilization
747: into util_pct
748: from msc_department_resources
749: where department_id = arg_dept_id
750: and resource_id = arg_resource_id
751: and plan_id = arg_plan_id
752: and organization_id = arg_org_id
779: end if;
780:
781: select resource_type
782: into v_resource_type
783: from msc_department_resources
784: where department_id = arg_dept_id
785: and resource_id = arg_resource_id
786: and plan_id = arg_plan_id
787: and organization_id = arg_org_id
812: v_org_code := msc_get_name.org_code(arg_org_id, arg_instance_id);
813:
814: select department_code || '/' || resource_code
815: into v_dept_resource_code
816: from msc_department_resources
817: where department_id = arg_dept_id
818: and resource_id = arg_resource_id
819: and plan_id = arg_plan_id
820: and organization_id = arg_org_id
833: v_org_code varchar2(15);
834:
835: CURSOR flag_c IS
836: select nvl(Batchable_flag,2)
837: from msc_department_resources
838: where department_id = arg_dept_id
839: and resource_id = arg_resource_id
840: and plan_id = arg_plan_id
841: and organization_id = arg_org_id
877: end if;
878:
879: select decode(min_capacity,0,null, min_capacity)
880: into v_res_min_capacity
881: from msc_department_resources
882: where department_id = arg_dept_id
883: and resource_id = arg_resource_id
884: and plan_id = arg_plan_id
885: and organization_id = arg_org_id
926: and rownum = 1;
927:
928: select decode(max_capacity,0 , null,max_capacity)
929: into v_res_max_capacity
930: from msc_department_resources
931: where department_id = arg_dept_id
932: and resource_id = arg_resource_id
933: and plan_id = arg_plan_id
934: and organization_id = arg_org_id
1977: p_resource_id number) return varchar2 IS
1978:
1979: CURSOR batchable_uom_cur IS
1980: SELECT unit_of_measure
1981: FROM msc_department_resources
1982: WHERE plan_id > -1
1983: and organization_id = p_organization_id
1984: and department_id = p_department_id
1985: and resource_id = p_resource_id;
3313: end if;
3314:
3315: select resource_group_name
3316: into l_group
3317: from msc_department_resources
3318: where department_id = arg_dept_id
3319: and resource_id = arg_resource_id
3320: and plan_id = arg_plan_id
3321: and organization_id = arg_org_id
3628: Mrr.Resource_Id,
3629: Mdr.Resource_Code,
3630: Mrr.Department_Id,
3631: Mdr.Department_Code
3632: From Msc_Department_Resources Mdr,
3633: Msc_Resource_Requirements Mrr
3634: Where Mrr.Transaction_Id = P_Res_Transaction_Id
3635: And Mrr.Plan_Id = P_Plan_Id
3636: And Mrr.Sr_Instance_Id = P_Sr_Instance_Id
4209:
4210: cursor cur(l_plan_id number ,l_sr_instance_id number ,l_organization_id number
4211: ,l_department_id number ,l_resource_id number) is
4212: select utilization_change_percent
4213: from msc_department_resources
4214: where plan_id = l_plan_id
4215: and sr_instance_id = l_sr_instance_id
4216: and organization_id = l_organization_id
4217: and department_id = l_department_id