DBA Data[Home] [Help]

APPS.CSI_PARTY_MERGE_PKG SQL Statements

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

Line: 25

   select 1
   from   csi_item_instances
   where  owner_party_id = p_from_fk_id
   and    owner_party_source_table = v_owner_party_source_table
   for    update nowait;
Line: 32

   select 1
   from   csi_item_instances
   where  ( install_location_type_code = v_install_location_type_code and install_location_id = p_from_fk_id ) or
          ( location_type_code         = v_install_location_type_code and location_id         = p_from_fk_id )
   for    update nowait;
Line: 61

      select internal_party_id
      into   v_internal_party_id
      from   csi_install_parameters;
Line: 81

   select merge_reason_code
   into   l_merge_reason_code
   from   hz_merge_batch
   where  batch_id  = p_batch_id;
Line: 112

            update csi_item_instances
            set    owner_party_id    = p_to_fk_id,
                   last_update_date  = SYSDATE,
                   last_updated_by   = G_USER_ID,
                   last_update_login = G_LOGIN_ID
            where  owner_party_id           = p_from_fk_id
            and    owner_party_source_table = v_owner_party_source_table;
Line: 122

            arp_message.set_name('AR', 'AR_ROWS_UPDATED');
Line: 127

            /* insert record into transaction table */
            v_no_of_rows := 0;
Line: 133

                  SELECT transaction_type_id
                  INTO   v_transaction_type_id
                  FROM   csi_txn_types
                  WHERE  source_transaction_type = v_source_transaction_type;
Line: 143

               SELECT transaction_id
               INTO   v_transaction_id
               FROM   csi_transactions
               WHERE  source_line_ref_id  = p_batch_id AND
                      transaction_type_id = v_transaction_type_id;
Line: 157

                     SELECT CSI_TRANSACTIONS_S.nextval
                     INTO   v_transaction_id
                     FROM   dual;
Line: 163

                  INSERT INTO csi_transactions(
                     transaction_id
                     ,transaction_date
                     ,source_transaction_date
                     ,transaction_type_id
                     ,source_line_ref_id
                     ,created_by
                     ,creation_date
                     ,last_updated_by
                     ,last_update_date
                     ,last_update_login
                     ,object_version_number
                     )
                  VALUES(
                     v_transaction_id
                     ,sysdate
                     ,sysdate
                     ,v_transaction_type_id
                     ,p_batch_id
       	             ,arp_standard.profile.user_id
                     ,sysdate
   	             ,arp_standard.profile.user_id
   	             ,sysdate
	             ,arp_standard.profile.user_id
	             ,1
                     );
Line: 194

          /* insert record into history table */
	    --
            INSERT INTO CSI_ITEM_INSTANCES_H
               (
		 INSTANCE_HISTORY_ID
		,INSTANCE_ID
		,TRANSACTION_ID
		,OLD_LOCATION_ID
		,NEW_LOCATION_ID
		,FULL_DUMP_FLAG
		,CREATED_BY
		,CREATION_DATE
		,LAST_UPDATED_BY
		,LAST_UPDATE_DATE
		,LAST_UPDATE_LOGIN
		,OBJECT_VERSION_NUMBER
                ,OLD_INST_LOC_ID
                ,NEW_INST_LOC_ID
	       )
	    SELECT
                 CSI_ITEM_INSTANCES_H_S.nextval
                ,cii.INSTANCE_ID
		,v_transaction_id
		,decode( cii.location_id, p_from_fk_id, cii.location_id,        null )
		,decode( cii.location_id, p_from_fk_id, p_to_fk_id,             null )
                ,'N'
                ,arp_standard.profile.user_id
                ,sysdate
                ,arp_standard.profile.user_id
                ,sysdate
                ,arp_standard.profile.user_id
		,1
                ,decode( cii.install_location_id, p_from_fk_id, cii.install_location_id,        null )
                ,decode( cii.install_location_id, p_from_fk_id, p_to_fk_id,                     null )
	    FROM   csi_item_instances cii
            WHERE  ( install_location_type_code = v_install_location_type_code and
                     install_location_id        = p_from_fk_id ) or
                   ( location_type_code         = v_install_location_type_code and
                     location_id                = p_from_fk_id );
Line: 235

            arp_message.set_Name('CSI', 'CSI_ROWS_INSERTED');
Line: 239

            v_error_message := 'Done with the insert of item instance history';
Line: 243

               After inserting into the history tables for the location(s) update,
               now update the install_location_id and location_id, if applicable
            */

            arp_message.set_name('AR', 'AR_LOCKING_TABLE');
Line: 256

	    update csi_item_instances
            set    install_location_id = decode( install_location_id, p_from_fk_id, p_to_fk_id, install_location_id ),
                   location_id         = decode( location_id,         p_from_fk_id, p_to_fk_id, location_id ),
                   last_update_date    = SYSDATE,
                   last_updated_by     = G_USER_ID,
                   last_update_login   = G_LOGIN_ID
            where  ( install_location_type_code = v_install_location_type_code and
                     install_location_id        = p_from_fk_id ) or
                   ( location_type_code         = v_install_location_type_code and
                     location_id                = p_from_fk_id );
Line: 269

            arp_message.set_name('AR', 'AR_ROWS_UPDATED');
Line: 311

   select 1
   from   csi_i_parties
   where  party_id           = p_from_fk_id
   and    party_source_table = v_party_source_table
   for    update nowait;
Line: 341

      select internal_party_id
      into   v_internal_party_id
      from   csi_install_parameters;
Line: 361

   select merge_reason_code
   into   l_merge_reason_code
   from   hz_merge_batch
   where  batch_id  = p_batch_id;
Line: 382

         /* insert record into transaction table */
         v_no_of_rows := 0;
Line: 387

               SELECT transaction_type_id
               INTO   v_transaction_type_id
               FROM   csi_txn_types
               WHERE  source_transaction_type = v_source_transaction_type;
Line: 396

            SELECT transaction_id
            INTO   v_transaction_id
            FROM   csi_transactions
            WHERE  source_line_ref_id  = p_batch_id
              AND  transaction_type_id = v_transaction_type_id;
Line: 405

                  SELECT CSI_TRANSACTIONS_S.nextval
                  INTO   v_transaction_id
                  FROM   dual;
Line: 409

               INSERT INTO csi_transactions
                  (
                    transaction_id
                   ,transaction_date
                   ,source_transaction_date
                   ,transaction_type_id
                   ,source_line_ref_id
                   ,created_by
                   ,creation_date
                   ,last_updated_by
                   ,last_update_date
                   ,last_update_login
                   ,object_version_number
                  )
               VALUES
                  (
                    v_transaction_id
                   ,sysdate
                   ,sysdate
                   ,v_transaction_type_id
                   ,p_batch_id
       	           ,arp_standard.profile.user_id
                   ,sysdate
   	           ,arp_standard.profile.user_id
   	           ,sysdate
	           ,arp_standard.profile.user_id
	           ,1
                  );
Line: 440

         /* insert record into history table */

         INSERT INTO csi_i_parties_h
            (
             instance_party_history_id,
             instance_party_id,
             transaction_id,
             old_party_source_table,
             new_party_source_table,
             old_party_id,
             new_party_id,
             full_dump_flag,
             created_by,
             creation_date,
             last_updated_by,
             last_update_date,
             last_update_login,
             object_version_number
            )
            SELECT csi_i_parties_h_s.nextval,
                   cip.instance_party_id,
                   v_transaction_id,
                   v_party_source_table,
                   v_party_source_table,
                   p_from_fk_id,
		   p_to_fk_id,
                   'N',
                   arp_standard.profile.user_id,
                   sysdate,
                   arp_standard.profile.user_id,
                   sysdate,
                   arp_standard.profile.user_id,
                   1
             FROM  csi_i_parties cip
             WHERE cip.party_source_table = v_party_source_table
	     AND   cip.party_id           = p_from_fk_id;
Line: 477

         arp_message.set_Name('CSI', 'CSI_ROWS_INSERTED');
Line: 481

         v_error_message := 'Done with the insert of party history';
Line: 492

	 update csi_i_parties
	 set    party_id            = p_to_fk_id,
	        last_update_date    = SYSDATE,
	        last_updated_by     = G_USER_ID,
	        last_update_login   = G_LOGIN_ID
         where  party_id            = p_from_fk_id
         and    party_source_table  = v_party_source_table;
Line: 502

         arp_message.set_name('AR', 'AR_ROWS_UPDATED');
Line: 538

   select 1
   from   csi_systems_b
   where  install_site_use_id = p_from_fk_id
   for    update nowait;
Line: 544

   select 1
   from   csi_systems_b
   where  ship_to_contact_id       = p_from_fk_id
   or     bill_to_contact_id       = p_from_fk_id
   or     technical_contact_id     = p_from_fk_id
   or     service_admin_contact_id = p_from_fk_id
   for    update nowait;
Line: 578

      select internal_party_id
      into   v_internal_party_id
      from   csi_install_parameters;
Line: 598

   select merge_reason_code
   into   l_merge_reason_code
   from   hz_merge_batch
   where  batch_id  = p_batch_id;
Line: 623

             SELECT transaction_type_id
             INTO   v_transaction_type_id
             FROM   csi_txn_types
             WHERE  source_transaction_type = v_source_transaction_type;
Line: 633

           SELECT transaction_id
           INTO   v_transaction_id
           FROM   csi_transactions
           WHERE  source_line_ref_id = p_batch_id
             AND  transaction_type_id = v_transaction_type_id;
Line: 645

                     SELECT CSI_TRANSACTIONS_S.nextval
                     INTO   v_transaction_id
                     FROM   dual;
Line: 650

                  INSERT INTO csi_transactions(
                     transaction_id
                     ,transaction_date
                     ,source_transaction_date
                     ,transaction_type_id
                     ,source_line_ref_id
                     ,created_by
                     ,creation_date
                     ,last_updated_by
                     ,last_update_date
                     ,last_update_login
                     ,object_version_number
                     )
                  VALUES(
                     v_transaction_id
                     ,sysdate
                     ,sysdate
                     ,v_transaction_type_id
                     ,p_batch_id
                     ,arp_standard.profile.user_id
                     ,sysdate
                     ,arp_standard.profile.user_id
                     ,sysdate
                     ,arp_standard.profile.user_id
                     ,1
                     );
Line: 682

            INSERT INTO csi_systems_h
               (system_history_id,
                system_id,
                transaction_id,
                old_install_site_use_id,
                new_install_site_use_id,
                full_dump_flag,
                created_by,
                creation_date,
                last_updated_by,
                last_update_date,
                last_update_login,
                object_version_number
               )
            SELECT csi_systems_h_s.nextval,
                   csb.system_id,
                   v_transaction_id,
                   p_from_fk_id,
                   p_to_fk_id,
                   'N',
                   arp_standard.profile.user_id,
                   sysdate,
                   arp_standard.profile.user_id,
                   sysdate,
                   arp_standard.profile.user_id,
                   1
             FROM  csi_systems_b csb
             WHERE csb.install_site_use_id = p_from_fk_id;
Line: 711

            arp_message.set_Name('CSI', 'CSI_ROWS_INSERTED');
Line: 715

            v_error_message := 'Done with the insert of systems history';
Line: 726

            update csi_systems_b
	    set    install_site_use_id = p_to_fk_id,
	           last_update_date    = SYSDATE,
	           last_updated_by     = G_USER_ID,
	           last_update_login   = G_LOGIN_ID
            where  install_site_use_id = p_from_fk_id;
Line: 735

            arp_message.set_name('AR', 'AR_ROWS_UPDATED');
Line: 742

            INSERT INTO csi_systems_h
               (
                system_history_id,
                system_id,
                transaction_id,
                old_ship_to_contact_id,
                new_ship_to_contact_id,
                old_bill_to_contact_id,
                new_bill_to_contact_id,
                old_technical_contact_id,
                new_technical_contact_id,
                old_service_admin_contact_id,
                new_service_admin_contact_id,
                full_dump_flag,
                created_by,
                creation_date,
                last_updated_by,
                last_update_date,
                last_update_login,
                object_version_number
               )
            SELECT csi_systems_h_s.nextval,
                   csb.system_id,
                   v_transaction_id,
                   decode( csb.ship_to_contact_id,       p_from_fk_id, p_from_fk_id, null ),
                   decode( csb.ship_to_contact_id,       p_from_fk_id, p_to_fk_id,   null ),
                   decode( csb.bill_to_contact_id,       p_from_fk_id, p_from_fk_id, null ),
                   decode( csb.bill_to_contact_id,       p_from_fk_id, p_to_fk_id,   null ),
                   decode( csb.technical_contact_id,     p_from_fk_id, p_from_fk_id, null ),
                   decode( csb.technical_contact_id,     p_from_fk_id, p_to_fk_id,   null ),
                   decode( csb.service_admin_contact_id, p_from_fk_id, p_from_fk_id, null ),
                   decode( csb.service_admin_contact_id, p_from_fk_id, p_to_fk_id,   null ),
                   'N',
                   arp_standard.profile.user_id,
                   sysdate,
                   arp_standard.profile.user_id,
                   sysdate,
                   arp_standard.profile.user_id,
                   1
             FROM  csi_systems_b csb
             WHERE ship_to_contact_id       = p_from_fk_id
               OR  bill_to_contact_id       = p_from_fk_id
               OR  technical_contact_id     = p_from_fk_id
               OR  service_admin_contact_id = p_from_fk_id ;
Line: 787

            arp_message.set_Name('CSI', 'CSI_ROWS_INSERTED');
Line: 791

            v_error_message := 'Done with the insert of systems history';
Line: 805

	    update csi_systems_b
            set    ship_to_contact_id       = decode( ship_to_contact_id,       p_from_fk_id, p_to_fk_id, ship_to_contact_id ),
                   bill_to_contact_id       = decode( bill_to_contact_id,       p_from_fk_id, p_to_fk_id, bill_to_contact_id ),
                   technical_contact_id     = decode( technical_contact_id,     p_from_fk_id, p_to_fk_id, technical_contact_id ),
                   service_admin_contact_id = decode( service_admin_contact_id, p_from_fk_id, p_to_fk_id, service_admin_contact_id ),
	           last_update_date         = SYSDATE,
	           last_updated_by          = G_USER_ID,
	           last_update_login        = G_LOGIN_ID
            where  ship_to_contact_id       = p_from_fk_id
               or  bill_to_contact_id       = p_from_fk_id
               or  technical_contact_id     = p_from_fk_id
               or  service_admin_contact_id = p_from_fk_id ;
Line: 820

            arp_message.set_name('AR', 'AR_ROWS_UPDATED');
Line: 860

   select 1
   from   csi_t_txn_systems
   where  install_site_use_id = p_from_fk_id
   for    update nowait;
Line: 866

   select 1
   from   csi_t_txn_systems
   where  ship_to_contact_id       = p_from_fk_id
      or  bill_to_contact_id       = p_from_fk_id
      or  technical_contact_id     = p_from_fk_id
      or  service_admin_contact_id = p_from_fk_id
   for    update nowait;
Line: 894

      select internal_party_id
      into   v_internal_party_id
      from   csi_install_parameters;
Line: 914

   select merge_reason_code
   into   l_merge_reason_code
   from   hz_merge_batch
   where  batch_id  = p_batch_id;
Line: 946

	    update csi_t_txn_systems
	    set    install_site_use_id = p_to_fk_id,
	           last_update_date    = SYSDATE,
	           last_updated_by     = G_USER_ID,
	           last_update_login   = G_LOGIN_ID
            where  install_site_use_id = p_from_fk_id;
Line: 955

            arp_message.set_name('AR', 'AR_ROWS_UPDATED');
Line: 968

	    update csi_t_txn_systems
	    set    bill_to_contact_id       = decode(bill_to_contact_id,   p_from_fk_id, p_to_fk_id, bill_to_contact_id ),
                   ship_to_contact_id       = decode(ship_to_contact_id,   p_from_fk_id, p_to_fk_id, ship_to_contact_id ),
                   technical_contact_id     = decode(technical_contact_id, p_from_fk_id, p_to_fk_id, technical_contact_id ),
                   service_admin_contact_id = decode(service_admin_contact_id,
                                                     p_from_fk_id, p_to_fk_id, service_admin_contact_id ),
	           last_update_date    = SYSDATE,
	           last_updated_by     = G_USER_ID,
	           last_update_login   = G_LOGIN_ID
            where  ship_to_contact_id       = p_from_fk_id
               or  bill_to_contact_id       = p_from_fk_id
               or  technical_contact_id     = p_from_fk_id
               or  service_admin_contact_id = p_from_fk_id;
Line: 984

            arp_message.set_name('AR', 'AR_ROWS_UPDATED');
Line: 1022

   select 1
   from   csi_t_party_details
   where  party_source_id = p_from_fk_id
   and    party_source_table = v_party_source_table
   for    update nowait;
Line: 1047

      select internal_party_id
      into   v_internal_party_id
      from   csi_install_parameters;
Line: 1067

   select merge_reason_code
   into   l_merge_reason_code
   from   hz_merge_batch
   where  batch_id  = p_batch_id;
Line: 1097

	 update csi_t_party_details
	 set    party_source_id     = p_to_fk_id,
	        last_update_date    = SYSDATE,
	        last_updated_by     = G_USER_ID,
	        last_update_login   = G_LOGIN_ID
         where  party_source_id     = p_from_fk_id
         and    party_source_table = v_party_source_table;
Line: 1107

         arp_message.set_name('AR', 'AR_ROWS_UPDATED');
Line: 1147

   select 1
   from   csi_t_txn_line_details
   where  ( location_id         = p_from_fk_id and location_type_code         = v_location_type_code )
   or     ( install_location_id = p_from_fk_id and install_location_type_code = v_location_type_code )
   for    update nowait;
Line: 1173

   select merge_reason_code
   into   l_merge_reason_code
   from   hz_merge_batch
   where  batch_id  = p_batch_id;
Line: 1201

	 update csi_t_txn_line_details
	 set    location_id         = decode( location_id,         p_from_fk_id, p_to_fk_id, location_id         ),
                install_location_id = decode( install_location_id, p_from_fk_id, p_to_fk_id, install_location_id ),
	        last_update_date    = SYSDATE,
	        last_updated_by     = G_USER_ID,
	        last_update_login   = G_LOGIN_ID
         where  ( location_id         = p_from_fk_id and location_type_code         = v_location_type_code )
         or     ( install_location_id = p_from_fk_id and install_location_type_code = v_location_type_code );
Line: 1212

         arp_message.set_name('AR', 'AR_ROWS_UPDATED');