DBA Data[Home] [Help]

APPS.BOM_VALIDATE_SUB_OP_RES SQL Statements

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

Line: 66

          SELECT 'Sub Res does not exist'
          FROM   SYS.DUAL
          WHERE  EXISTS (SELECT  NULL
                         FROM    WIP_DISCRETE_JOBS  wdj
                         WHERE   wdj.lot_number = p_lot_number
                         AND     (wdj.status_type <> 1
                                  OR
                                  NOT EXISTS(SELECT NULL
                                             FROM   WIP_SUB_OPERATION_RESOURCES wsor
                                             WHERE  substitute_group_num = p_sub_group_num
                                             AND    resource_id          = p_resource_id
                                             AND    operation_seq_num = p_operation_seq_num
                                             AND    wip_entity_id     = wdj.wip_entity_id)
                                  )
                         AND      wdj.lot_number = p_lot_number
                        ) ;
Line: 89

          SELECT 'Sub Res does not exist'
          FROM  DUAL
          WHERE NOT EXISTS ( SELECT  NULL
                             FROM    WIP_DISCRETE_JOBS  wdj
                             WHERE   wdj.lot_number = p_lot_number
                             AND     wdj.status_type = 1
                             AND EXISTS ( SELECT NULL
                                          FROM   WIP_SUB_OPERATION_RESOURCES wsor
                                          WHERE  substitute_group_num = p_sub_group_num
                                          AND    resource_id          = p_resource_id
                                          AND    operation_seq_num    = p_operation_seq_num
                                          AND    wip_entity_id        = wdj.wip_entity_id
                                        )
                           );
Line: 110

          SELECT 'Sub Res does not exist'
          FROM   SYS.DUAL
          WHERE  EXISTS (SELECT  NULL
                         FROM    WIP_DISCRETE_JOBS  wdj
                               , WIP_ENTITIES       we
                               , WIP_ENTITIES       we1
                               , WIP_ENTITIES       we2
                         WHERE   (wdj.status_type <> 1
                                  OR
                                  NOT EXISTS (SELECT NULL
                                              FROM   WIP_SUB_OPERATION_RESOURCES wsor
                                              WHERE  substitute_group_num = p_sub_group_num
                                              AND    resource_id          = p_resource_id
                                              AND    operation_seq_num = p_operation_seq_num
                                              AND    wip_entity_id     = wdj.wip_entity_id)
                                 )
                         AND     wdj.wip_entity_id = we.wip_entity_id
                         AND     we.wip_entity_name >= we1.wip_entity_name
                         AND     we.wip_entity_name <= we2.wip_entity_name
                         AND     we1.wip_entity_id = p_from_wip_entity_id
                         AND     we2.wip_entity_id = NVL(p_to_wip_entity_id, p_from_wip_entity_id)
                         ) ;
Line: 140

          SELECT 'Sub Res does not exist'
          FROM   SYS.DUAL
          WHERE  EXISTS (SELECT  NULL
                         FROM    WIP_DISCRETE_JOBS  wdj
                         WHERE   (wdj.status_type <> 1
                                  OR
                                  NOT EXISTS(SELECT NULL
                                             FROM   WIP_SUB_OPERATION_RESOURCES wsor
                                             WHERE  substitute_group_num = p_sub_group_num
                                             AND    resource_id          = p_resource_id
                                             AND    operation_seq_num = p_operation_seq_num
                                             AND    wip_entity_id     = wdj.wip_entity_id)
                                 )
                         AND     wdj.wip_entity_id = p_from_wip_entity_id
                         ) ;
Line: 252

          SELECT 'Related Schedule Resource does not exist'
          FROM   SYS.DUAL
          WHERE  NOT EXISTS( SELECT NULL
                             FROM   BOM_OPERATION_RESOURCES
                             WHERE  schedule_flag         = p_schedule_flag
                             AND    substitute_group_num  = p_sub_group_num
                             AND    operation_sequence_id = p_op_seq_id
                            ) ;
Line: 268

          SELECT 'Already exists'
          FROM   SYS.DUAL
          WHERE  EXISTS( SELECT NULL
                         FROM   BOM_SUB_OPERATION_RESOURCES
                         WHERE  schedule_flag         =  p_schedule_flag
                         AND    resource_id           <> p_resource_id
                         AND    substitute_group_num  =  p_sub_group_num
                         AND    operation_sequence_id =  p_op_seq_id
                        ) ;
Line: 321

          SELECT 'Related PO Move Resource does not exist'
          FROM   SYS.DUAL
          WHERE  NOT EXISTS( SELECT NULL
                             FROM   BOM_OPERATION_RESOURCES
                             WHERE  autocharge_type       = l_PO_MOVE
                             AND    substitute_group_num  = p_sub_group_num
                             AND    operation_sequence_id = p_op_seq_id
                            ) ;
Line: 335

          SELECT 'Already exists'
          FROM   SYS.DUAL
          WHERE  EXISTS( SELECT NULL
                         FROM   BOM_SUB_OPERATION_RESOURCES
                         WHERE  autocharge_type       =  l_PO_MOVE
                         AND    resource_id           <> p_resource_id
                         AND    substitute_group_num  =  p_sub_group_num
                         AND    operation_sequence_id =  p_op_seq_id
                        ) ;
Line: 380

        SELECT old_operation_sequence_id
        INTO   l_old_op_seq_id
        FROM   BOM_OPERATION_SEQUENCES
        WHERE  operation_sequence_id = p_op_seq_id ;
Line: 411

          SELECT 'Already exists'
          FROM   SYS.DUAL
          WHERE  EXISTS( SELECT NULL
                         FROM   BOM_SUB_OPERATION_RESOURCES
                         WHERE  principle_flag = 1 -- Yes
                         AND    NVL(acd_type, l_ACD_ADD) <> l_ACD_DISABLE
                         AND    (
                                    ( resource_id <> p_res_id )
                                OR  ( ( resource_id = p_res_id )
                                      AND ( basis_type <> p_basis_type
                                           OR schedule_flag <> p_schedule_flag ) ) /* Added for bug 13005178 */
                                )
                         AND    substitute_group_num  = p_sub_group_num
                         AND    replacement_group_num = p_rep_group_num
                         AND    operation_sequence_id = p_op_seq_id
                        ) ;
Line: 474

       SELECT resource_id
       FROM   bom_operation_resources
       WHERE  operation_sequence_id = p_op_seq_id
       AND    nvl(schedule_seq_num,resource_seq_num) = p_sch_seq_num
       AND    schedule_flag not in (p_sch_flag,l_NO_SCHEDULE)
       AND    rownum=1;
Line: 482

       SELECT resource_id
       FROM   bom_sub_operation_resources
       WHERE  operation_sequence_id = p_op_seq_id
       AND    schedule_seq_num      = p_sch_seq_num
       AND    schedule_flag not in (p_sch_flag,l_NO_SCHEDULE)
       AND    (
                   substitute_group_num  <> p_sub_grp_num
               OR  replacement_group_num <> p_rep_grp_num
               OR        basis_type              <> p_basis_type
               OR        resource_id              <> p_in_res_id
               )
       AND    rownum=1;
Line: 608

    *                 is UPDATE and record DOES NOT EXIST.
    *                 In case of UPDATE if record exists, then the procedure
    *                 will return old record in the old entity parameters
    *                 with a success status.
    *********************************************************************/

    PROCEDURE Check_Existence
    (  p_rev_sub_resource_rec        IN  Bom_Rtg_Pub.Rev_Sub_Resource_rec_Type
     , p_rev_sub_res_unexp_rec       IN  Bom_Rtg_Pub.Rev_Sub_Res_Unexposed_Rec_Type
     , x_old_rev_sub_resource_rec    IN OUT NOCOPY Bom_Rtg_Pub.Rev_Sub_Resource_rec_Type
     , x_old_rev_sub_res_unexp_rec   IN OUT NOCOPY Bom_Rtg_Pub.Rev_Sub_Res_Unexposed_Rec_Type
     , x_mesg_token_tbl              IN OUT NOCOPY Error_Handler.Mesg_Token_Tbl_Type
     , x_return_status               IN OUT NOCOPY VARCHAR2
    )
    IS
       l_Token_Tbl      Error_Handler.Token_Tbl_Type;
Line: 648

           SELECT  br.DEFAULT_BASIS_TYPE
           INTO    l_default_basis_type
           FROM    BOM_RESOURCES br
           WHERE   br.RESOURCE_ID = p_rev_sub_res_unexp_rec.resource_id;
Line: 688

                    (BOM_Rtg_Globals.G_OPR_UPDATE, BOM_Rtg_Globals.G_OPR_DELETE)
            THEN
                    Error_Handler.Add_Error_Token
                    (  x_Mesg_token_tbl => l_Mesg_Token_Tbl
                     , p_Mesg_Token_Tbl => l_Mesg_Token_Tbl
                     , p_message_name   => 'BOM_SUB_RES_DOESNOT_EXIST'
                     , p_token_tbl      => l_token_tbl
                    ) ;
Line: 767

    * Procedure : Check_Attribute (Validation) for CREATE and UPDATE
    *             by ECO BO  and internally called by RTG BO
    * Parameters IN : Revised Sub Operation Resource exposed column record
    *                 Revised Sub Operation Resource unexposed column record
    * Parameters out: Return Status
    *                 Message Token Table
    * Purpose   : Attribute validation procedure will validate each
    *             attribute of Sub Revised operation resource in its entirety.
    *             If the validation of a column requires looking at some
    *             other columns value then the validation is done at
    *             the Entity level instead.
    *             All errors in the attribute validation are accumulated
    *             before the procedure returns with a Return_Status
    *             of 'E'.
    *********************************************************************/
    PROCEDURE Check_Attributes
    (  p_rev_sub_resource_rec   IN  Bom_Rtg_Pub.Rev_Sub_Resource_rec_Type
     , p_rev_sub_res_unexp_rec  IN  Bom_Rtg_Pub.Rev_Sub_Res_Unexposed_Rec_Type
     , x_mesg_token_tbl         IN OUT NOCOPY Error_Handler.Mesg_Token_Tbl_Type
     , x_return_status          IN OUT NOCOPY VARCHAR2
    )
    IS

    l_return_status     VARCHAR2(1) ;
Line: 812

        IF p_rev_sub_resource_rec.transaction_type = BOM_Rtg_Globals.G_OPR_UPDATE
        THEN

        IF Bom_Rtg_Globals.Get_Debug = 'Y' THEN Error_Handler.Write_Debug
        ('Sub Operation Resource Attr Validation: Missing Value. . . ' ) ;
Line: 987

                (  p_Message_Name       => 'BOM_SUB_RES_CODE_NOTUPDATE'
                 , p_Mesg_Token_Tbl     => l_Mesg_Token_Tbl
                 , x_Mesg_Token_Tbl     => l_Mesg_Token_Tbl
                 , p_Token_Tbl          => l_Token_Tbl
                 );
Line: 1196

              OR (p_rev_sub_resource_rec.transaction_type = BOM_Rtg_Globals.G_OPR_UPDATE
                  AND p_rev_sub_resource_rec.schedule_sequence_number = FND_API.G_MISS_NUM)
              OR p_rev_sub_resource_rec.schedule_sequence_number = 0
            THEN
               Error_Handler.Add_Error_Token
               (  p_Message_Name       => 'BOM_SSN_ZERO_VALUE'
                , p_Mesg_Token_Tbl     => l_Mesg_Token_Tbl
                , x_Mesg_Token_Tbl     => l_Mesg_Token_Tbl
                --, p_Token_Tbl          => l_Token_Tbl
               );
Line: 1373

	SELECT count(setup_id)
	FROM bom_resource_setups
	WHERE resource_id = p_resource_id
	AND organization_id = p_org_id;
Line: 1387

       SELECT 'Rev Sub Op Resource Not Exists'
       FROM   DUAL
       WHERE NOT EXISTS (SELECT NULL
                         FROM  BOM_OPERATION_SEQUENCES bos
                             , BOM_SUB_OPERATION_RESOURCES bsor
                         WHERE bsor.substitute_group_num  = p_sub_group_num
                         AND   bsor.resource_id           = p_resource_id
                         AND   bsor.operation_sequence_id = bos.operation_sequence_id
                         AND   bos.operation_sequence_id  = p_op_seq_id
                         ) ;
Line: 1408

        SELECT 'Sub Res Duplicate'
        FROM   DUAL
        WHERE  EXISTS  ( SELECT NULL
                         FROM   BOM_SUB_OPERATION_RESOURCES
                         WHERE  NVL(ACD_TYPE, 1)         = NVL(p_acd_type, 1)
                         AND    BASIS_TYPE               = p_basis_type
                         AND    RESOURCE_ID              = p_resource_id
                         AND    SUBSTITUTE_GROUP_NUM     = p_substitute_group_number
                         AND    REPLACEMENT_GROUP_NUM    = p_replacement_group_number -- bug 3741570
                         AND    OPERATION_SEQUENCE_ID    = p_op_seq_id
                         AND    SCHEDULE_FLAG            = p_schedule_flag  /* Added filter for bug 13005178 */
                        ) ;
Line: 1511

                l_token_tbl.delete(3) ;
Line: 1542

                l_token_tbl.delete(3) ;
Line: 1551

          IF  l_rev_sub_resource_rec.Transaction_Type = BOM_Rtg_Globals.G_OPR_UPDATE
              AND l_rev_sub_resource_rec.acd_type <> p_old_rev_sub_resource_rec.acd_type
          THEN
             IF FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_ERROR)
             THEN
                Error_Handler.Add_Error_Token
                ( p_message_name    => 'BOM_SUB_RES_ACDTPNT_UPDATEABLE'
                , p_Mesg_Token_Tbl => l_Mesg_Token_Tbl
                , x_Mesg_Token_Tbl => l_Mesg_Token_Tbl
                , p_token_tbl      => l_token_tbl
                ) ;
Line: 1602

                l_token_tbl.delete(3) ;
Line: 1616

	(BOM_Rtg_Globals.G_OPR_CREATE, BOM_Rtg_Globals.G_OPR_UPDATE)
	THEN
	--
	-- APS Enhancement for Routings.
	-- Verify that if a resource has setups defined, or is Batchable then
	-- the Assigned Units for that Resource have to be 1.
	--
	  IF p_rev_sub_resource_rec.assigned_units <> FND_API.G_MISS_NUM THEN
		OPEN get_setups (p_rev_sub_res_unexp_rec.resource_id, p_rev_sub_res_unexp_rec.organization_id);
Line: 1627

		SELECT nvl(batchable,2) INTO l_batchable
		FROM bom_resources
		WHERE resource_id = p_rev_sub_res_unexp_rec.resource_id;
Line: 1652

       IF l_rev_sub_resource_rec.Transaction_Type = BOM_Rtg_Globals.G_OPR_UPDATE

          -- In this release, Acd type : Change is not allowed.
          --
          -- OR
          -- (l_rev_sub_resource_rec.Transaction_Type = BOM_Rtg_Globals.G_OPR_CREATE
          --  AND  l_rev_sub_resource_rec.acd_type    = l_ACD_CHANGE
          --  )
       THEN
            NULL ;
Line: 1662

       END IF ;  --  Transation: UPDATE
Line: 1666

       ('End of Validation specific to the Transaction Type of Update' || l_return_status) ;
Line: 1673

         ( BOM_Rtg_Globals.G_OPR_CREATE, BOM_Rtg_Globals.G_OPR_UPDATE )
       THEN

       IF BOM_Rtg_Globals.Get_Debug = 'Y' THEN Error_Handler.Write_Debug
       ('Common Validateion for Transaction Type : Create and Update . . . . ' || l_return_status) ;
Line: 1740

                AND l_rev_sub_resource_rec.transaction_type = BOM_Rtg_Globals.G_OPR_UPDATE
             THEN

                 FOR l_duplicate_rec  IN  l_duplicate_csr
                 (    p_resource_id            => NVL(l_rev_sub_res_unexp_rec.new_resource_id,
                                                      l_rev_sub_res_unexp_rec.resource_id )
                    , p_substitute_group_number => nvl(l_rev_sub_resource_rec.substitute_group_number,
                                                       l_rev_sub_res_unexp_rec.substitute_group_number)
                    , p_replacement_group_number => NVL(l_rev_sub_resource_rec.new_replacement_Group_number, -- bug 3741570
                                                        l_rev_sub_resource_rec.replacement_Group_number)
                    , p_op_seq_id              => l_rev_sub_res_unexp_rec.operation_sequence_id
                    , p_acd_type               => l_rev_sub_resource_rec.acd_type
                    , p_basis_type             => NVL(l_rev_sub_resource_rec.new_basis_type,
                                                      l_rev_sub_resource_rec.basis_type)
                    , p_schedule_flag          => NVL(l_rev_sub_resource_rec.new_schedule_flag,
 	                                                       l_rev_sub_resource_rec.schedule_flag)      /* Added for bug 13005178 */
                  )

                 LOOP
                    l_Token_Tbl(1).token_name  := 'SUB_RESOURCE_CODE';
Line: 1780

                    l_token_tbl.delete(3) ;
Line: 1824

                    l_token_tbl.delete(3) ;
Line: 1947

                l_token_tbl.delete(3) ;
Line: 2437

                                   Select resource_code into l_res_code
                                   from bom_resources_v
                                   where resource_id=l_rev_sub_res_unexp_rec.resource_id;
Line: 2442

                                   Select resource_code into l_res_code_2
                                   from bom_resources_v
                                   where resource_id=l_res_id;
Line: 2466

       END IF ; -- Transaction Type : Create and Update