DBA Data[Home] [Help]

APPS.GMD_OPERATION_RESOURCES_PUB SQL Statements

The following lines contain the word 'select', 'insert', 'update' or 'delete':

Line: 28

  Function  : This package contains public procedures used to create, modify, and delete operation resources
  Pre-reqs  : N/A
  Parameters: Per function

  Current Vers  : 1.0

  Previous Vers : 1.0

  Initial Vers  : 1.0
  Notes
*/

  /* Global Cursors */
  CURSOR check_oprn_line_id(V_oprn_line_id NUMBER) IS
     SELECT 1
     FROM gmd_operation_activities
     WHERE oprn_line_id = v_oprn_line_id;
Line: 49

     SELECT 1
     FROM mtl_units_of_measure
     WHERE uom_Code = v_uom
       AND (disable_date IS NULL or disable_date > SYSDATE);    /* pku */
Line: 56

      SELECT 1
      FROM cm_cmpt_mst
      WHERE COST_CMPNTCLS_id = v_cost_cmpntcls_id
                      AND delete_mark = 0;
Line: 62

      SELECT 1
      FROM cm_alys_mst
      WHERE cost_analysis_code = v_cost_analysis_code
                      AND delete_mark = 0;
Line: 68

      SELECT 1
      FROM gmd_operation_resources
      WHERE oprn_line_id = p_oprn_line_id
      AND  resources = p_resources;
Line: 74

      SELECT COUNT(1)
      FROM gmd_operation_resources
      WHERE oprn_line_id = V_oprn_line_id
      AND prim_rsrc_ind  = 1;
Line: 80

      SELECT COUNT(1)
      FROM gmd_operation_resources
      WHERE oprn_line_id = V_oprn_line_id
      AND  (V_resources IS NULL OR resources <> V_resources)
      AND  prim_rsrc_ind = 1;
Line: 104

     insert_operation_resources
  Description
    This particular procedure is used to insert an
    operation resources Parameters
  ================================================ */
  PROCEDURE insert_operation_resources
  ( p_api_version 	IN 	    NUMBER
  , p_init_msg_list	IN 	    BOOLEAN
  , p_commit		IN 	    BOOLEAN
  , p_oprn_line_id	IN	    gmd_operation_activities.oprn_line_id%TYPE
  , p_oprn_rsrc_tbl	IN 	    gmd_operation_resources_pub.gmd_oprn_resources_tbl_type
  , x_message_count 	OUT NOCOPY  NUMBER
  , x_message_list 	OUT NOCOPY  VARCHAR2
  , x_return_status	OUT NOCOPY  VARCHAR2)  IS

    v_resources		   gmd_operation_resources.resources%TYPE;
Line: 133

      SELECT oprn_id
      FROM   gmd_operation_activities
      WHERE  oprn_line_id = V_oprn_line_id;
Line: 138

      SELECT process_qty_uom
      FROM   gmd_operations a, gmd_operation_activities b
      WHERE  a.oprn_id = b.oprn_id
      AND    b.oprn_line_id = V_oprn_line_id;
Line: 144

      SELECT cr.cost_cmpntcls_id
      FROM   cr_rsrc_mst cr, cm_cmpt_mst cm
      WHERE  cr.cost_cmpntcls_id = cm.cost_cmpntcls_id
      AND    cr.resources = V_resources
      AND    cr.delete_mark = 0
      AND    cm.delete_mark = 0
      AND    cm.usage_ind = 3;
Line: 153

      SELECT cost_analysis_code
      FROM   fm_actv_mst a, gmd_operation_activities o
      WHERE  o.activity = a.activity
      AND    o.oprn_line_id = V_oprn_line_id;
Line: 160

      SELECT std_usage_uom
      FROM   cr_rsrc_mst
      WHERE  resources = V_resources;
Line: 170

    SAVEPOINT insert_oprn_rsrc;
Line: 185

                                       ,'insert_operation_resources'
                                       ,'gmd_operation_resources_pub') THEN
      RAISE invalid_version;
Line: 196

      gmd_debug.put_line('In insert_operation_resources public.');
Line: 228

    /* Validation: Chcek if this users performing update has access to this
       operation owner orgn code */
    IF NOT GMD_API_GRP.Check_orgn_access(Entity     => 'OPERATION'
                                        ,Entity_id  => l_oprn_id) THEN
      RAISE ins_oprn_rsrc_err;
Line: 417

      GMD_OPERATION_RESOURCES_PVT.insert_operation_resources(p_oprn_line_id 	=> p_oprn_line_id,
							     p_oprn_rsrc_tbl 	=> l_oprn_rsrc_tbl,
         				  		     x_message_count 	=>   x_message_count,
        				  		     x_message_list     =>   x_message_list,
       				  			     x_return_status    =>   l_return_status);
Line: 455

      gmd_debug.put_line('End of insert_operation_resource PUB');
Line: 459

      ROLLBACK TO SAVEPOINT insert_oprn_rsrc;
Line: 464

      ROLLBACK TO SAVEPOINT insert_oprn_rsrc;
Line: 469

      ROLLBACK TO SAVEPOINT insert_oprn_rsrc;
Line: 476

  END insert_operation_resources;
Line: 480

     update_operation_resources
  Description
    This particular procedure is used to update operation resources
    Parameters
  ================================================ */
  PROCEDURE update_operation_resources
  ( p_api_version 		IN 	NUMBER
  , p_init_msg_list 		IN 	BOOLEAN
  , p_commit			IN 	BOOLEAN
  , p_oprn_line_id		IN	gmd_operation_resources.oprn_line_id%TYPE
  , p_resources			IN	gmd_operation_resources.resources%TYPE
  , p_update_table		IN	gmd_operation_resources_pub.update_tbl_type
  , x_message_count 		OUT NOCOPY  	NUMBER
  , x_message_list 		OUT NOCOPY  	VARCHAR2
  , x_return_status		OUT NOCOPY  	VARCHAR2)    IS

     v_oprn_id 			gmd_operations.oprn_id%TYPE;
Line: 505

      SELECT oprn_id
      FROM gmd_operation_activities
      WHERE oprn_line_id = p_oprn_line_id;
Line: 511

    SAVEPOINT update_oprn_rsrc;
Line: 519

                                       ,'update_operation_resources'
                                       ,'gmd_operation_resources_pub') THEN
      RAISE invalid_version;
Line: 537

       gmd_debug.put_line('Start of update_operation_activity PUB');
Line: 577

    /* Loop thru cols to be updated - verify col and value are present */
    FOR i in 1 .. p_update_table.count LOOP
      /* Col_to_update and value must be passed, otherwise give error */
      IF p_update_table(i).p_col_to_update IS NULL THEN
        FND_MESSAGE.SET_NAME ('GMI', 'GMI_MISSING');
Line: 582

        FND_MESSAGE.SET_TOKEN ('MISSING', 'P_COL_TO_UPDATE');
Line: 585

      ELSIF p_update_table(i).p_value IS NULL THEN
        FND_MESSAGE.SET_NAME ('GMI', 'GMI_MISSING');
Line: 590

      ELSIF UPPER(p_update_table(i).p_col_to_update) = 'COST_ANALYSIS_CODE' THEN
        OPEN check_cost_analysis_code(p_update_table(i).p_value);
Line: 600

      ELSIF UPPER(p_update_table(i).p_col_to_update) = 'RESOURCE_USAGE' THEN
        IF p_update_table(i).p_value < 0 THEN
          gmd_api_grp.log_message('FM_RESUSGERR');
Line: 605

      ELSIF UPPER(p_update_table(i).p_col_to_update) = 'PROCESS_QTY' THEN
        IF p_update_table(i).p_value < 0 THEN
          gmd_api_grp.log_message('FM_PROCQTYERR');
Line: 610

      ELSIF UPPER(p_update_table(i).p_col_to_update) = 'resource_usage_uom' THEN
        OPEN check_uom(p_update_table(i).p_value);
Line: 621

      ELSIF UPPER(p_update_table(i).p_col_to_update) = 'COST_CMPNTCLS_ID' THEN
        OPEN check_cost_cmpntcls_id(p_update_table(i).p_value);
Line: 631

      ELSIF UPPER(p_update_table(i).p_col_to_update) = 'PRIM_RSRC_IND' THEN
        IF p_update_table(i).p_value NOT IN (0, 1, 2) THEN
          gmd_api_grp.log_message ('FM_RSRCINDERR');
Line: 635

        ELSIF p_update_table(i).p_value = 1 THEN
          /* This implies that we are setting this current resource as primary */
          /* so let us check if their are any other primaries already existing */
          OPEN  check_one_prim_rsrc (p_oprn_line_id);
Line: 645

        ELSIF p_update_table(i).p_value IN (0,2) THEN
          /* This implies that we are setting this current resource as secondary or auxillary */
          /* so let us check if their exists atleast one primary resource */
          OPEN  check_atleast_one (p_oprn_line_id, p_resources);
Line: 656

      ELSIF UPPER(p_update_table(i).p_col_to_update) = 'RESOURCE_COUNT' THEN
        IF p_update_table(i).p_value < 0 THEN
          gmd_api_grp.log_message ('FM_RESCOUNTERR');
Line: 661

      ELSIF UPPER(p_update_table(i).p_col_to_update) = 'OFFSET_INTERVAL' THEN
        IF p_update_table(i).p_value < 0 THEN
          gmd_api_grp.log_message('GMD_INVALID_OFFSET');
Line: 666

      ELSIF UPPER(p_update_table(i).p_col_to_update) = 'SCALE_TYPE' THEN
        IF p_update_table(i).p_value NOT IN (0, 1, 2) THEN
          gmd_api_grp.log_message ('FM_SCALETYPERR');
Line: 679

    /* Validation: Chcek if this users performing update has access to this
       operation owner orgn code */
    IF NOT GMD_API_GRP.Check_orgn_access(Entity     => 'OPERATION'
                                    ,Entity_id  => v_oprn_id) THEN
      RAISE upd_oprn_rsrc_err;
Line: 687

    and Operation is not logically deleted */
    IF NOT GMD_COMMON_VAL.UPDATE_ALLOWED(Entity => 'OPERATION',
                                         Entity_id => v_oprn_id ) THEN
      FND_MESSAGE.SET_NAME('GMD', 'GMD_OPRN_NOT_VALID');
Line: 700

      GMD_OPERATION_RESOURCES_PVT.update_operation_resources(p_oprn_line_id 	=> p_oprn_line_id
       							, p_resources 		=> p_resources
       							, p_update_table	=> p_update_table
       							, x_message_count 	=> x_message_count
       							, x_message_list 	=> x_message_list
       							, x_return_status 	=> l_return_status);
Line: 718

      gmd_debug.put_line('END of update_operation_resource PUB');
Line: 723

      ROLLBACK TO SAVEPOINT update_oprn_rsrc;
Line: 728

      ROLLBACK TO SAVEPOINT update_oprn_rsrc;
Line: 733

       ROLLBACK TO SAVEPOINT update_oprn_rsrc;
Line: 740

  END update_operation_resources;
Line: 744

   delete_operation_resources
  Description
    This particular procedure is used to delete operation resources
    Parameters
  ================================================ */
  PROCEDURE delete_operation_resources
  ( p_api_version 		IN 	NUMBER
  , p_init_msg_list 		IN 	BOOLEAN
  , p_commit		IN 	BOOLEAN
  , p_oprn_line_id		IN	gmd_operation_resources.oprn_line_id%TYPE
  , p_resources		IN 	gmd_operation_resources.resources%TYPE
  , x_message_count 		OUT NOCOPY  	NUMBER
  , x_message_list 		OUT NOCOPY  	VARCHAR2
  , x_return_status		OUT NOCOPY  	VARCHAR2)  IS

   v_update_table   		gmd_operation_resources_pub.update_tbl_type;
Line: 771

     SELECT 1
     FROM gmd_operation_activities
     WHERE oprn_line_id = p_oprn_line_id;
Line: 776

     SELECT 1
     FROM gmd_operation_resources
     WHERE oprn_line_id = p_oprn_line_id
     AND   resources = p_resources;
Line: 782

      SELECT oprn_id
      FROM gmd_operation_activities
      WHERE oprn_line_id = p_oprn_line_id;
Line: 787

    SAVEPOINT delete_oprn_rsrc;
Line: 800

                                       ,'delete_operation_resources'
                                       ,'gmd_operation_resources_pub') THEN
      RAISE invalid_version;
Line: 813

       gmd_debug.put_line('START of delete_operation_resources PUB');
Line: 853

    /* Validation: Chcek if this users performing update has access to this
       operation owner orgn code */
    IF NOT GMD_API_GRP.Check_orgn_access(Entity     => 'OPERATION'
                                    ,Entity_id  => v_oprn_id) THEN
      RAISE del_oprn_rsrc_err;
Line: 862

      /* Call PVT delete_operation_resources */
      IF (l_debug = 'Y') THEN
        gmd_debug.put_line('before call to delete_operation_resource PVT');
Line: 866

      gmd_operation_resources_pvt.delete_operation_resource(p_oprn_line_id    => p_oprn_line_id
            						   ,p_resources    => p_resources
                       					   , x_message_count => x_message_count
		       					   , x_message_list 	=> x_message_list
       							   , x_return_status 	=> l_return_status);
Line: 894

       gmd_debug.put_line('END of delete_operation_resources PUB');
Line: 899

        ROLLBACK TO SAVEPOINT delete_oprn_rsrc;
Line: 904

        ROLLBACK TO SAVEPOINT delete_oprn_rsrc;
Line: 909

         ROLLBACK TO SAVEPOINT delete_oprn_rsrc;
Line: 916

  END delete_operation_resources;