DBA Data[Home] [Help]

APPS.CSP_CMERGE_BB4 SQL Statements

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

Line: 35

    1) Update the system_ship_to_site_use_id
    2) Update the system_install_site_use_id
    3) Update the cp_ship_to_site_use_id
    4) Update the cp_install_site_use_id
    5) Update the customer_id

 ---------------------------------------------------------------------------- */

PROCEDURE MERGE ( req_id       IN NUMBER,
                  set_number   IN NUMBER,
                  process_mode IN VARCHAR2 ) IS

/* used to store a free form text to be written to the log file */

        message_text          char(80);
Line: 51

/* number of rows updated */

        number_of_rows        NUMBER;
Line: 73

/* merge the CS_TEMPLATES_INTERFACE table update system ship to site use id */

        message_text := '***-- Procedure CS_MERGE_SYS_SHIP_SITE_ID --**';
Line: 83

/* merge the CS_TEMPLATES_INTERFACE table update system install site use id */

        message_text := '***-- Procedure CS_MERGE_SYS_INSTALL_SITE_ID --**';
Line: 93

/* merge the CS_TEMPLATES_INTERFACE table update cp ship to site use id */

        message_text := '***-- Procedure CS_MERGE_CP_SHIP_SITE_ID --**';
Line: 103

/* merge the CS_TEMPLATES_INTERFACE table update cp install site use id */

        message_text := '***-- Procedure CS_MERGE_CP_INSTALL_SITE_ID --**';
Line: 113

/* merge the CS_TEMPLATES_INTERFACE table update the customer_id */

        message_text := '***-- Procedure CS_MERGE_CUSTOMER_ID --**';
Line: 124

   check to make sure all data has been updated. If not report it to the
   log file.  */

        CS_CHECK_MERGE_DATA ( req_id, set_number, process_mode );
Line: 145

/* Update the ship use site id of CS_TEMPLATES_INTERFACE */

PROCEDURE CS_MERGE_SYS_SHIP_SITE_ID( req_id       IN NUMBER,
                                     set_number   IN NUMBER,
     				     process_mode IN VARCHAR2 ) IS

/* used to store a free form text to be written to the log file */

        message_text          char(80);
Line: 155

/* number of rows updated */

        number_of_rows        NUMBER;
Line: 160

        SELECT system_ship_to_site_use_id
        FROM   CS_TEMPLATES_INTERFACE yt, RA_CUSTOMER_MERGES RACM
        WHERE
               yt.system_ship_to_site_use_id IN ( SELECT RACM.DUPLICATE_SITE_ID
                                		  FROM   RA_CUSTOMER_MERGES RACM
                                		  WHERE  RACM.PROCESS_FLAG = 'N'
                                 		  AND    RACM.REQUEST_ID   = req_id
                                 		  AND    RACM.SET_NUMBER   = set_number )
        AND    yt.customer_id <> RACM.DUPLICATE_ID
        FOR UPDATE NOWAIT;
Line: 190

             UPDATE CS_TEMPLATES_INTERFACE yt
             SET
               yt.system_ship_to_site_use_id =
                                ( SELECT DISTINCT RACM.CUSTOMER_SITE_ID
                                  FROM   RA_CUSTOMER_MERGES RACM
                                  WHERE  yt.system_ship_to_site_use_id
                                         = RACM.DUPLICATE_SITE_ID
                                  AND    RACM.PROCESS_FLAG = 'N'
                                  AND    RACM.REQUEST_ID   = req_id
                                  AND    RACM.SET_NUMBER   = set_number )
             WHERE
               yt.system_ship_to_site_use_id IN ( SELECT RACM.DUPLICATE_SITE_ID
                                  		  FROM   RA_CUSTOMER_MERGES RACM
                                  		  WHERE  RACM.PROCESS_FLAG = 'N'
                                 		  AND    RACM.REQUEST_ID   = req_id
                                 		  AND    RACM.SET_NUMBER   = set_number );
Line: 207

             arp_message.set_name( 'CS', 'CS_ROWS_UPDATED');
Line: 210

             message_text := 'Done with the update of system_ship_to_site_use_id';
Line: 221

              arp_message.set_name( 'CS', 'CS_ROWS_UPDATED');
Line: 224

              message_text := 'Done with the update of system_ship_to_site_use_id';
Line: 236

/* Update the ship use site id of CS_TEMPLATES_INTERFACE */

PROCEDURE CS_MERGE_SYS_INSTALL_SITE_ID ( req_id       IN NUMBER,
                                         set_number   IN NUMBER,
					 process_mode IN VARCHAR2 ) IS

/* used to store a free form text to be written to the log file */

        message_text          char(80);
Line: 246

/* number of rows updated */

        number_of_rows        NUMBER;
Line: 251

        SELECT system_install_site_use_id
        FROM   CS_TEMPLATES_INTERFACE yt, RA_CUSTOMER_MERGES RACM
        WHERE
               yt.system_install_site_use_id IN ( SELECT RACM.DUPLICATE_SITE_ID
                                		  FROM   RA_CUSTOMER_MERGES RACM
                                		  WHERE  RACM.PROCESS_FLAG = 'N'
                                 		  AND    RACM.REQUEST_ID   = req_id
                                 		  AND    RACM.SET_NUMBER   = set_number )
        AND    yt.customer_id <> RACM.DUPLICATE_ID
	FOR UPDATE NOWAIT;
Line: 277

                     'Starting to update the system_install_site_use_id ( 2/5 )';
Line: 280

             UPDATE CS_TEMPLATES_INTERFACE yt
             SET
               yt.system_install_site_use_id =
                                ( SELECT DISTINCT RACM.CUSTOMER_SITE_ID
                                  FROM   RA_CUSTOMER_MERGES RACM
                                  WHERE  yt.system_install_site_use_id
                                         = DUPLICATE_SITE_ID
                                  AND    RACM.PROCESS_FLAG = 'N'
                                  AND    RACM.REQUEST_ID   = req_id
                                  AND    RACM.SET_NUMBER   = set_number )
             WHERE
               yt.system_install_site_use_id IN ( SELECT RACM.DUPLICATE_SITE_ID
                                                  FROM   RA_CUSTOMER_MERGES RACM
                                                  WHERE  RACM.PROCESS_FLAG = 'N'
                                   		  AND    RACM.REQUEST_ID   = req_id
                                  		  AND    RACM.SET_NUMBER   = set_number );
Line: 297

             arp_message.set_name( 'CS', 'CS_ROWS_UPDATED');
Line: 300

             message_text := 'Done with the update of system_install_site_use_id';
Line: 311

              arp_message.set_name( 'CS', 'CS_ROWS_UPDATED');
Line: 314

              message_text := 'Done with the update of system_install_site_use_id';
Line: 326

/* Update the ship use site id of CS_TEMPLATES_INTERFACE */

PROCEDURE CS_MERGE_CP_SHIP_SITE_ID( req_id       IN NUMBER,
                                    set_number   IN NUMBER,
				    process_mode IN VARCHAR2 ) IS

/* used to store a free form text to be written to the log file */

        message_text          char(80);
Line: 336

/* number of rows updated */

        number_of_rows        NUMBER;
Line: 341

        SELECT cp_ship_to_site_use_id
        FROM   CS_TEMPLATES_INTERFACE yt, RA_CUSTOMER_MERGES RACM
        WHERE
               yt.cp_ship_to_site_use_id IN ( SELECT RACM.DUPLICATE_SITE_ID
                               		      FROM   RA_CUSTOMER_MERGES RACM
                                              WHERE  RACM.PROCESS_FLAG = 'N'
                                 	      AND    RACM.REQUEST_ID   = req_id
                                 	      AND    RACM.SET_NUMBER   = set_number )
        AND    yt.customer_id <> RACM.DUPLICATE_ID
	FOR UPDATE NOWAIT;
Line: 366

             message_text := 'Starting to update the cp_ship_to_site_use_id ( 3/5 )';
Line: 369

             UPDATE CS_TEMPLATES_INTERFACE yt
             SET
               yt.cp_ship_to_site_use_id =
                                ( SELECT DISTINCT RACM.CUSTOMER_SITE_ID
                                  FROM   RA_CUSTOMER_MERGES RACM
                                  WHERE  yt.cp_ship_to_site_use_id
                                         = DUPLICATE_SITE_ID
                                  AND    RACM.PROCESS_FLAG = 'N'
                                  AND    RACM.REQUEST_ID   = req_id
                                  AND    RACM.SET_NUMBER   = set_number )
             WHERE
               yt.cp_ship_to_site_use_id IN ( SELECT RACM.DUPLICATE_SITE_ID
                                   	      FROM   RA_CUSTOMER_MERGES RACM
                                  	      WHERE  RACM.PROCESS_FLAG = 'N'
                                   	      AND    RACM.REQUEST_ID   = req_id
                                   	      AND    RACM.SET_NUMBER   = set_number );
Line: 386

             arp_message.set_name( 'CS', 'CS_ROWS_UPDATED');
Line: 389

             message_text := 'Done with the update of cp_ship_to_site_use_id';
Line: 399

              arp_message.set_name( 'CS', 'CS_ROWS_UPDATED');
Line: 402

              message_text := 'Done with the update of cp_ship_to_site_use_id';
Line: 414

/* Update the ship use site id of CS_TEMPLATES_INTERFACE */

PROCEDURE CS_MERGE_CP_INSTALL_SITE_ID ( req_id       IN NUMBER,
                                        set_number   IN NUMBER,
					process_mode IN VARCHAR2 ) IS

/* used to store a free form text to be written to the log file */

        message_text          char(80);
Line: 424

/* number of rows updated */

        number_of_rows        NUMBER;
Line: 429

        SELECT cp_install_site_use_id
        FROM   CS_TEMPLATES_INTERFACE yt, RA_CUSTOMER_MERGES RACM
        WHERE
               yt.cp_install_site_use_id IN ( SELECT RACM.DUPLICATE_SITE_ID
                                	      FROM   RA_CUSTOMER_MERGES RACM
                                	      WHERE  RACM.PROCESS_FLAG = 'N'
                                              AND    RACM.REQUEST_ID   = req_id
                                 	      AND    RACM.SET_NUMBER   = set_number )
        AND    yt.customer_id <> RACM.DUPLICATE_ID
	FOR UPDATE NOWAIT;
Line: 455

                     'Starting to update the cp_install_site_use_id ( 4/5 )';
Line: 458

             UPDATE CS_TEMPLATES_INTERFACE yt
             SET
               yt.cp_install_site_use_id =
                                ( SELECT DISTINCT RACM.CUSTOMER_SITE_ID
                                  FROM   RA_CUSTOMER_MERGES RACM
                                  WHERE  yt.cp_install_site_use_id
                                         = DUPLICATE_SITE_ID
                                  AND    RACM.PROCESS_FLAG = 'N'
                                  AND    RACM.REQUEST_ID   = req_id
                                  AND    RACM.SET_NUMBER   = set_number )
             WHERE
               yt.cp_install_site_use_Id IN ( SELECT RACM.DUPLICATE_SITE_ID
                                              FROM   RA_CUSTOMER_MERGES RACM
                                  	      WHERE  RACM.PROCESS_FLAG = 'N'
                                  	      AND    RACM.REQUEST_ID   = req_id
                                	      AND    RACM.SET_NUMBER   = set_number );
Line: 475

             arp_message.set_name( 'CS', 'CS_ROWS_UPDATED');
Line: 478

             message_text := 'Done with the update of cp_install_site_use_id';
Line: 488

              arp_message.set_name( 'CS', 'CS_ROWS_UPDATED');
Line: 491

              message_text := 'Done with the update of cp_install_site_use_id';
Line: 503

/* This process updates the customer_id of the CS_TEMPLATES_INTERFACE table */

PROCEDURE CS_MERGE_CUSTOMER_ID (req_id       IN NUMBER,
                                set_number   IN NUMBER,
 				process_mode IN VARCHAR2 ) IS

/* used to store a free form text to be written to the log file */

        message_text          char(80);
Line: 513

/* number of rows updated */

        number_of_rows        NUMBER;
Line: 518

        SELECT yt.customer_id
        FROM   CS_TEMPLATES_INTERFACE yt, RA_CUSTOMER_MERGES RACM
        WHERE
               yt.customer_id IN ( SELECT RACM.DUPLICATE_ID
                                   FROM   RA_CUSTOMER_MERGES RACM
                                   WHERE  RACM.PROCESS_FLAG = 'N'
                                   AND    RACM.REQUEST_ID   = req_id
                                   AND    RACM.SET_NUMBER   = set_number )
	FOR UPDATE NOWAIT;
Line: 542

             message_text := 'Starting to update the customer_id ( 5/5 )';
Line: 545

             UPDATE CS_TEMPLATES_INTERFACE yt
             SET
               yt.customer_id = ( SELECT DISTINCT RACM.CUSTOMER_ID
                                  FROM   RA_CUSTOMER_MERGES RACM
                                  WHERE  yt.customer_id    = DUPLICATE_ID
                                  AND    RACM.PROCESS_FLAG = 'N'
                                  AND    RACM.REQUEST_ID   = req_id
                                  AND    RACM.SET_NUMBER   = set_number )
             WHERE
               yt.customer_id IN ( SELECT RACM.DUPLICATE_ID
                                   FROM   RA_CUSTOMER_MERGES RACM
                                   WHERE  RACM.PROCESS_FLAG = 'N'
                                   AND    RACM.REQUEST_ID   = req_id
                                   AND    RACM.SET_NUMBER   = set_number );
Line: 560

             arp_message.set_name( 'CS', 'CS_ROWS_UPDATED');
Line: 563

             message_text := 'Done with the update of customer_id';
Line: 573

              arp_message.set_name( 'CS', 'CS_ROWS_UPDATED');
Line: 576

              message_text := 'Done with the update of customer_id';
Line: 604

/* number of rows updated */

        number_of_rows        NUMBER;
Line: 610

              SELECT
               DISTINCT
                cs.templates_interface_id
     	      FROM CS_TEMPLATES_INTERFACE CS,
      	           RA_CUSTOMER_MERGES RACM
              WHERE
                RACM.PROCESS_FLAG = 'N'        AND
                RACM.REQUEST_ID   = req_id     AND
                RACM.SET_NUMBER   = set_number AND
            ((( cs.customer_id  = RACM.CUSTOMER_ID AND
                cs.system_ship_to_site_use_id <> racm.customer_site_id AND
                cs.system_ship_to_site_use_id IS NOT NULL ) AND
              ( cs.customer_id NOT IN ( select racm.customer_id
                                        from CS_TEMPLATES_INTERFACE CS,
					     RA_CUSTOMER_MERGES RACM
                                        where cs.customer_id  = RACM.CUSTOMER_ID AND
                                        cs.system_ship_to_site_use_id = racm.customer_site_id or
                                        cs.system_ship_to_site_use_id IS NULL ))) AND
             (( cs.customer_id  = RACM.CUSTOMER_ID AND
                cs.system_install_site_use_id <> racm.customer_site_id   AND
                cs.system_install_site_use_id IS NOT NULL  ) AND
              ( cs.customer_id NOT IN ( select racm.customer_id
                                        from CS_TEMPLATES_INTERFACE CS,
					     RA_CUSTOMER_MERGES RACM
                                        where cs.customer_id  = RACM.CUSTOMER_ID AND
                                        cs.system_install_site_use_id = racm.customer_site_id or
                                        cs.system_install_site_use_id IS NULL ))) AND
             (( cs.customer_id  = RACM.CUSTOMER_ID AND
                cs.cp_install_site_use_id     <> racm.customer_site_id   AND
                cs.cp_install_site_use_id     IS NOT NULL )  AND
              ( cs.customer_id NOT IN ( select racm.customer_id
                                        from CS_TEMPLATES_INTERFACE CS,
					     RA_CUSTOMER_MERGES RACM
                                        where cs.customer_id  = RACM.CUSTOMER_ID AND
                                        cs.cp_install_site_use_id = racm.customer_site_id or
                                        cs.cp_install_site_use_id IS NULL ))) AND
             (( cs.customer_id  = RACM.CUSTOMER_ID AND
                cs.cp_ship_to_site_use_id     <> racm.customer_site_id   AND
                cs.cp_ship_to_site_use_id     IS NOT NULL ) AND
              ( cs.customer_id NOT IN ( select racm.customer_id
                                        from CS_TEMPLATES_INTERFACE CS,
					     RA_CUSTOMER_MERGES RACM
                                        where cs.customer_id  = RACM.CUSTOMER_ID AND
                                        cs.cp_ship_to_site_use_id = racm.customer_site_id or
                                        cs.cp_ship_to_site_use_id IS NULL ))) );