DBA Data[Home] [Help]

APPS.INVP_CMERGE_SPDM SQL Statements

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

Line: 16

   SELECT NULL
   FROM   MTL_DEMAND
   WHERE  bill_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_num)
   FOR UPDATE NOWAIT;
Line: 26

   SELECT NULL
   FROM   MTL_DEMAND
   WHERE  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_num)
   FOR UPDATE NOWAIT;
Line: 36

   SELECT NULL
   FROM   MTL_DEMAND
   WHERE  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_num)
          and ship_to_site_use_id is NULL
          and bill_to_site_use_id is NULL
   FOR UPDATE NOWAIT;
Line: 74

 arp_message.set_line('site level update : ship to and bill to site use id');
Line: 76

    UPDATE MTL_DEMAND yt
    set customer_id = (select distinct racm.customer_id
		        from ra_customer_merges racm
		        where yt.customer_id = racm.duplicate_id
			and (yt.ship_to_site_use_id = racm.duplicate_site_id
                             or yt.bill_to_site_use_id = racm.duplicate_site_id)
                        and racm.process_flag= 'N'
			and racm.request_id = req_id
			and racm.set_number = set_num),
         ship_to_site_use_id = (select distinct racm.customer_site_id
                        from   ra_customer_merges racm
                      	where  yt.customer_id = racm.duplicate_id
                        and    yt.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_num),
         bill_to_site_use_id = (select distinct racm.customer_site_id
                        from   ra_customer_merges racm
                      	where  yt.customer_id = racm.duplicate_id
                        and    yt.bill_to_site_use_id = racm.duplicate_site_id
                        and    racm.process_flag = 'N'
                        and    racm.request_id = req_id
			and    racm.set_number = set_num),
           last_update_date = sysdate,
           last_updated_by = arp_standard.profile.user_id,
           last_update_login = arp_standard.profile.last_update_login,
           request_id = req_id,
           program_application_id = arp_standard.profile.program_application_id,
           program_id = arp_standard.profile.program_id,
           program_update_date = sysdate
    where  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_num)
    and    bill_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_num);
Line: 119

   /* Number of rows updates */
   arp_message.set_name('AR', 'AR_ROWS_UPDATED');
Line: 124

/* site level update */
/* for bill to site use id */
 arp_message.set_name('AR', 'AR_UPDATING_TABLE');
Line: 128

 arp_message.set_line('site level update : bill to site use id');
Line: 130

    UPDATE MTL_DEMAND yt
    set    (customer_id,
            bill_to_site_use_id) = (select distinct racm.customer_id,
                                        racm.customer_site_id
                        from   ra_customer_merges racm
                        where  yt.customer_id = racm.duplicate_id
                        and    yt.bill_to_site_use_id = racm.duplicate_site_id
                        and    racm.process_flag = 'N'
                        and    racm.request_id = req_id
			and    racm.set_number = set_num),
           last_update_date = sysdate,
           last_updated_by = arp_standard.profile.user_id,
           last_update_login = arp_standard.profile.last_update_login,
           request_id = req_id,
           program_application_id =arp_standard.profile.program_application_id,
           program_id = arp_standard.profile.program_id,
           program_update_date = sysdate
    where  bill_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_num)
    and    (ship_to_site_use_id is NULL
	    or ship_to_site_use_id not 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_num));
Line: 161

   /* Number of rows updates */
   arp_message.set_name('AR', 'AR_ROWS_UPDATED');
Line: 166

/* site level update */
/* for ship to site use id */

 arp_message.set_name('AR', 'AR_UPDATING_TABLE');
Line: 171

 arp_message.set_line('site level update : ship to site use id');
Line: 173

    UPDATE MTL_DEMAND yt
    set    (customer_id,
            ship_to_site_use_id) = (select distinct racm.customer_id,
                                        racm.customer_site_id
                        from   ra_customer_merges racm
                        where  yt.customer_id = racm.duplicate_id
                        and    yt.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_num),
           last_update_date = sysdate,
           last_updated_by = arp_standard.profile.user_id,
           last_update_login = arp_standard.profile.last_update_login,
           request_id = req_id,
           program_application_id =arp_standard.profile.program_application_id,
           program_id = arp_standard.profile.program_id,
           program_update_date = sysdate
    where  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_num)
    and    (bill_to_site_use_id is NULL
	    or bill_to_site_use_id not 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_num));
Line: 204

   /* Number of rows updates */
   arp_message.set_name('AR', 'AR_ROWS_UPDATED');
Line: 208

/* customer level update */

 arp_message.set_name('AR', 'AR_UPDATING_TABLE');
Line: 214

    UPDATE MTL_DEMAND  yt
    set    customer_id = (select distinct racm.customer_id
                          from   ra_customer_merges racm
                          where  yt.customer_id =
                                    racm.duplicate_id
                          and    racm.process_flag = 'N'
                          and    racm.request_id = req_id
			  and    racm.set_number = set_num),
           last_update_date = sysdate,
           last_updated_by = arp_standard.profile.user_id,
           last_update_login = arp_standard.profile.last_update_login,
           request_id = req_id,
           program_application_id =arp_standard.profile.program_application_id,
           program_id = arp_standard.profile.program_id,
           program_update_date = sysdate
    where  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_num)
    and ship_to_site_use_id is NULL
    and bill_to_site_use_id is NULL;
Line: 239

   /* Number of rows updates */
   arp_message.set_name('AR', 'AR_ROWS_UPDATED');