DBA Data[Home] [Help]

APPS.POS_SPM_WF_PKG1 SQL Statements

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

Line: 17

      SELECT function_id
        FROM fnd_form_functions
        WHERE function_name = p_function_name;
Line: 67

        SELECT vendor_name
          FROM ap_suppliers
          WHERE vendor_id = p_vendor_id;
Line: 176

       SELECT ppf.first_name, ppf.last_name
       FROM per_people_f ppf, fnd_user fu
         WHERE fu.employee_id = ppf.person_id
         AND fu.user_id = p_user_id;
Line: 181

        SELECT hp.person_first_name, hp.person_last_name
          FROM hz_parties hp, fnd_user fu
          WHERE fu.person_party_id = hp.party_id
          AND fu.user_id = p_user_id;
Line: 186

        SELECT user_name FROM fnd_user WHERE user_id = p_user_id;
Line: 233

        SELECT employee_id
          FROM fnd_user
          WHERE user_name = p_username;
Line: 310

     SELECT user_name
       FROM fnd_user fu, pos_spmntf_subscription sub
      WHERE fu.user_id = sub.user_id
        AND sub.event_type = p_event_type;
Line: 320

	SELECT Decode(par.party_site_id, NULL, par.party_site_name,
		      (SELECT hps.party_site_name
		       FROM hz_party_sites hps
		       WHERE hps.party_site_id = par.party_site_id
		       )) address_name
	  FROM pos_address_requests par
	  WHERE par.address_request_id = p_address_request_id;
Line: 481

PROCEDURE notify_addr_updated
(p_vendor_id          IN  NUMBER,
   p_address_request_id IN NUMBER,
   x_itemtype      	OUT nocopy VARCHAR2,
   x_itemkey       	OUT nocopy VARCHAR2,
   x_receiver      	OUT nocopy VARCHAR2
   )
  IS
BEGIN
   notify_addr_events
     (p_vendor_id          => p_vendor_id,
      p_address_request_id => p_address_request_id,
      p_wf_process    	   => 'PADDR_UPDATED',
      x_itemtype      	   => x_itemtype,
      x_itemkey       	   => x_itemkey,
      x_receiver      	   => x_receiver
      );
Line: 498

END notify_addr_updated;
Line: 503

	SELECT flv.meaning
	  FROM fnd_lookup_values flv, pos_bus_class_reqs pbcr
         WHERE flv.lookup_type = pbcr.lookup_type
	   AND flv.lookup_code = pbcr.lookup_code
	   AND flv.language = userenv('LANG')
	   AND flv.lookup_type = 'POS_BUSINESS_CLASSIFICATIONS'
	   AND pbcr.bus_class_request_id = p_bus_class_request_id;
Line: 638

   select classification_id
   into l_class_id
   from pos_bus_class_reqs
   where bus_class_request_id = p_bus_class_request_id;
Line: 647

    notify_bus_class_updated (p_vendor_id, p_bus_class_request_id,
        x_itemtype, x_itemkey, x_receiver);
Line: 674

PROCEDURE notify_bus_class_updated
  (p_vendor_id            IN  NUMBER,
   p_bus_class_request_id IN  NUMBER,
   x_itemtype       	  OUT nocopy VARCHAR2,
   x_itemkey        	  OUT nocopy VARCHAR2,
   x_receiver       	  OUT nocopy VARCHAR2
  )
  IS
BEGIN
   notify_bus_class_changed
     ('PBUS_CLASS_UPDATED', p_vendor_id, p_bus_class_request_id, x_itemtype, x_itemkey, x_receiver);
Line: 685

END notify_bus_class_updated;
Line: 690

	SELECT Decode(pcr.contact_party_id, NULL, pcr.first_name || ' ' || pcr.last_name,
		      (SELECT hp.party_name
		       FROM hz_parties hp
		       WHERE hp.party_id = pcr.contact_party_id
		       )) contact_name
	  FROM pos_contact_requests pcr
	  WHERE pcr.contact_request_id = p_contact_request_id;
Line: 848

PROCEDURE notify_contact_updated
  (p_vendor_id          IN  NUMBER,
   p_contact_request_id IN  NUMBER,
   x_itemtype           OUT nocopy VARCHAR2,
   x_itemkey            OUT nocopy VARCHAR2,
   x_receiver           OUT nocopy VARCHAR2
   )
  IS
BEGIN
   notify_contact_events
     ('PCONTACT_UPDATED', p_vendor_id, p_contact_request_id, x_itemtype, x_itemkey, x_receiver);
Line: 859

END notify_contact_updated;
Line: 1125

        SELECT fu.user_name
          FROM hz_relationships hzr, hz_parties hp, fnd_user fu
          WHERE
          fu.person_party_id = hp.party_id
          AND fu.email_address IS NOT NULL
          AND fu.end_date IS NULL
          AND hzr.object_id  = p_supplier_party_id
          AND hzr.subject_type = 'PERSON'
          AND hzr.object_type = 'ORGANIZATION'
          AND hzr.relationship_type = 'POS_EMPLOYMENT'
          AND hzr.relationship_code = 'EMPLOYEE_OF'
          AND hzr.status  = 'A'
          AND (hzr.start_date IS NULL OR
               hzr.start_date <= Sysdate)
          AND (hzr.end_date IS NULL OR
                 hzr.end_date >= Sysdate)
          AND hzr.subject_id = hp.party_id
          ORDER BY hp.creation_date asc;
Line: 1167

        SELECT fu.user_name
          FROM hz_relationships hzr, hz_parties hp, fnd_user fu, ap_suppliers ap, hz_party_usg_assignments hpua
          WHERE fu.person_party_id = hp.party_id
          AND fu.email_address IS NOT NULL
          AND fu.end_date IS NULL
          AND ap.vendor_id = p_vendor_id
          AND hzr.object_id  = ap.party_id
          AND hzr.subject_type = 'PERSON'
          AND hzr.object_type = 'ORGANIZATION'
          AND hzr.relationship_type = 'CONTACT'
          AND hzr.relationship_code = 'CONTACT_OF'
          AND hzr.status  = 'A'
          AND (hzr.start_date IS NULL OR
               hzr.start_date <= Sysdate)
          AND (hzr.end_date IS NULL OR
                 hzr.end_date >= Sysdate)
          AND hzr.subject_id = hp.party_id
          and hpua.party_id = hp.party_id
          and hpua.status_flag = 'A'
          and hpua.party_usage_code = 'SUPPLIER_CONTACT'
          and (hpua.effective_end_date is null OR hpua.effective_end_date > sysdate);
Line: 1192

        SELECT pvsa.email_address, ft.nls_territory, pvsa.language
        FROM ap_supplier_sites_all pvsa, fnd_territories ft
        WHERE pvsa.email_address IS NOT NULL
        AND pvsa.vendor_id = p_vendor_id
        AND (pvsa.inactive_date IS NULL OR pvsa.inactive_date IS NOT NULL AND pvsa.inactive_date > Sysdate)
        AND pvsa.country = ft.territory_code (+);
Line: 1204

        select hp.person_first_name, hp.person_last_name, hzr_hp.email_address
        from hz_parties hp, hz_relationships hzr, hz_parties hzr_hp, hz_party_usg_assignments hpua, ap_suppliers apsupp
        where hp.party_id = hzr.subject_id
        and hzr.object_id = apsupp.party_id
        and apsupp.vendor_id = p_vendor_id
        and hzr.relationship_type = 'CONTACT'
        and hzr.relationship_code = 'CONTACT_OF'
        and hzr.subject_type ='PERSON'
        and hzr.object_type = 'ORGANIZATION'
        and (hzr.end_date is null or hzr.end_date > sysdate)
        and hzr.status = 'A'
        and hzr_hp.party_id = hzr.party_id
        and hpua.party_id = hp.party_id
        and hpua.status_flag = 'A'
        and hpua.party_usage_code = 'SUPPLIER_CONTACT'
        and (hpua.effective_end_date is null OR hpua.effective_end_date > sysdate)
        and hp.party_id not in ( select pcr.contact_party_id
          from pos_contact_requests pcr, pos_supplier_mappings psm
          where pcr.request_status='PENDING'
          and psm.mapping_id = pcr.mapping_id
          and psm.PARTY_ID = apsupp.party_id
          and pcr.contact_party_id is not null )
        and hzr_hp.email_address is not null;
Line: 1398

        SELECT ou_id
          FROM pos_supplier_registrations
          WHERE supplier_reg_id = p_supplier_reg_id;
Line: 1416

        SELECT supplier_name
          FROM pos_supplier_registrations
          WHERE supplier_reg_id = p_supplier_reg_id;
Line: 1522

        SELECT fu.email_address
          FROM fnd_user fu
          WHERE fu.user_id = l_user_id;
Line: 1527

        SELECT ppf.first_name, ppf.last_name
          FROM fnd_user fu, per_people_f ppf
          WHERE fu.user_id = l_user_id AND
          ppf.person_id = fu.employee_id;
Line: 1744

	SELECT email_address, first_name, last_name
	  FROM pos_contact_requests
	 WHERE mapping_id IN (SELECT mapping_id FROM pos_supplier_mappings WHERE supplier_reg_id = p_supplier_reg_id)
           AND do_not_delete = 'Y';
Line: 1840

        SELECT note_to_supplier
          FROM pos_supplier_registrations
          WHERE supplier_reg_id = l_supplier_reg_id;
Line: 1925

           select DISTINCT fu.user_name
           from fnd_user fu,
                fnd_responsibility fr,
                fnd_user_resp_groups_direct furg,
                hz_relationships hr1, ap_suppliers ap_sup, hz_party_usg_assignments hpua
           where fr.menu_id IN
                 (SELECT fme.menu_id
                  FROM fnd_menu_entries fme
                  START WITH fme.function_id = l_function_id
                  CONNECT BY PRIOR menu_id = sub_menu_id
                 )
           AND   ( furg.end_date is null or furg.end_date > sysdate )
           AND   furg.security_group_id = 0
           AND   fr.responsibility_id = furg.responsibility_id
           AND   fr.application_id = furg.responsibility_application_id
           AND   fu.user_id = furg.user_id
           and   fu.person_party_id = hr1.subject_id
           and   hr1.subject_type = 'PERSON'
           and   hr1.relationship_type = 'CONTACT'
           and   hr1.relationship_code = 'CONTACT_OF'
           and   hr1.object_type = 'ORGANIZATION'
           and   hr1.status = 'A'
           and   hr1.start_date <= sysdate
           and   ( hr1.end_date IS NULL OR hr1.end_date > sysdate)
           and   hr1.object_id = ap_sup.party_id
           and   ap_sup.vendor_id = l_vendor_id
           and   hpua.party_id = hr1.subject_id
           and   hpua.status_flag = 'A'
           and   hpua.party_usage_code = 'SUPPLIER_CONTACT'
           and   (hpua.effective_end_date is null OR hpua.effective_end_date > sysdate);
Line: 2012

      create_adhoc_role('PACCOUNT_UPDATED_'||l_bank_account_number, l_receiver);
Line: 2055

     select DISTINCT psuv.user_name
     from fnd_responsibility fr,
     fnd_user_resp_groups_direct furg,
     pos_supplier_users_v psuv
     where fr.menu_id IN
     (SELECT fme.menu_id
      FROM fnd_menu_entries fme
      START WITH fme.function_id = l_function_id
      CONNECT BY PRIOR menu_id = sub_menu_id
      )
     AND ( furg.end_date is null or furg.end_date > sysdate )
       AND furg.security_group_id = 0
       AND fr.responsibility_id = furg.responsibility_id
       AND fr.application_id = furg.responsibility_application_id
       AND psuv.user_id = furg.user_id
       AND psuv.vendor_id = p_vendor_id;
Line: 2340

PROCEDURE notify_account_update
  (p_vendor_id           IN NUMBER,
   p_bank_name           IN VARCHAR2,
   p_bank_account_number IN VARCHAR2,
   p_currency_code       IN VARCHAR2,
   p_bank_account_name   IN VARCHAR2,
   x_itemtype      	 OUT nocopy VARCHAR2,
   x_itemkey       	 OUT nocopy VARCHAR2)
  IS
     l_itemtype wf_items.item_type%TYPE;
Line: 2369

   l_process := 'PACCOUNT_UPDATED';
Line: 2437

      wf_core.context(g_package_name,'NOTIFY_ACCOUNT_UPDATE',l_itemtype,l_itemkey);
Line: 2440

END notify_account_update;
Line: 2442

PROCEDURE notify_buyer_update_account
  (p_vendor_id           IN NUMBER,
   p_bank_name           IN VARCHAR2,
   p_bank_account_number IN VARCHAR2,
   p_currency_code       IN VARCHAR2,
   p_bank_account_name   IN VARCHAR2,
   x_itemtype      	 OUT nocopy VARCHAR2,
   x_itemkey       	 OUT nocopy VARCHAR2)
  IS
     l_itemtype wf_items.item_type%TYPE;
Line: 2471

   l_process := 'PACCT_BUYER_UPDATE';
Line: 2540

      wf_core.context(g_package_name,'NOTIFY_BUYER_UPDATE_ACCOUNT',l_itemtype,l_itemkey);
Line: 2543

END notify_buyer_update_account;
Line: 2886

	SELECT psr.reg_key, pcr.first_name, pcr.last_name, pcr.email_address
	  FROM pos_supplier_registrations psr,
	       pos_contact_requests pcr,
	       pos_supplier_mappings psm
	 WHERE psr.supplier_reg_id = psm.supplier_reg_id
	   AND psr.supplier_reg_id = p_supplier_reg_id
  	   AND pcr.mapping_id = psm.mapping_id
	   AND pcr.do_not_delete = 'Y';
Line: 2959

	SELECT psr.reg_key, pcr.first_name, pcr.last_name, pcr.email_address
	  FROM pos_supplier_registrations psr,
	       pos_contact_requests pcr,
	       pos_supplier_mappings psm
	 WHERE psr.supplier_reg_id = psm.supplier_reg_id
	   AND psr.supplier_reg_id = p_supplier_reg_id
  	   AND pcr.mapping_id = psm.mapping_id
	   AND pcr.do_not_delete = 'Y';
Line: 3318

    SELECT APS.VENDOR_ID
    FROM AP_SUPPLIERS APS
    WHERE
      Trunc(APS.BUS_CLASS_LAST_CERTIFIED_DATE) + To_Number(FND_PROFILE.Value('POS_BUS_CLASS_RECERT_PERIOD')) = Trunc(SYSDATE) + To_Number(FND_PROFILE.Value('POS_BUS_CLASS_RECERT_REMIND_DAYS'))
      OR
      (
        Trunc(SYSDATE) > Trunc(APS.BUS_CLASS_LAST_CERTIFIED_DATE + To_Number(FND_PROFILE.Value('POS_BUS_CLASS_RECERT_PERIOD')))
        AND
        Mod ( To_Number(Trunc(SYSDATE) - Trunc(APS.BUS_CLASS_LAST_CERTIFIED_DATE)) - To_Number(FND_PROFILE.Value('POS_BUS_CLASS_RECERT_PERIOD'))
             ,To_Number(FND_PROFILE.Value('POS_BUS_CLASS_RECERT_REMIND_DAYS'))
            ) = 0
       )
       OR APS.BUS_CLASS_LAST_CERTIFIED_DATE IS NULL;
Line: 3333

    SELECT fu.user_name, fu.email_address
    FROM hz_relationships hzr, hz_parties hp, fnd_user fu, ap_suppliers ap, hz_party_usg_assignments hpua
    WHERE
      fu.user_id in (select spm.user_id from pos_spmntf_subscription spm
                     where spm.event_type = 'SUPP_BUS_CLASS_RECERT_NTF')
      AND fu.person_party_id = hp.party_id
      AND fu.email_address IS NOT NULL
      AND fu.end_date IS NULL
      AND ap.vendor_id = l_vendor_id
      AND hzr.object_id  = ap.party_id
      AND hzr.subject_type = 'PERSON'
      AND hzr.object_type = 'ORGANIZATION'
      AND hzr.relationship_type = 'CONTACT'
      AND hzr.relationship_code = 'CONTACT_OF'
      AND hzr.status  = 'A'
      AND (hzr.start_date IS NULL OR hzr.start_date <= Sysdate)
      AND (hzr.end_date IS NULL OR hzr.end_date >= Sysdate)
      AND hzr.subject_id = hp.party_id
      AND hpua.party_id = hp.party_id
      AND hpua.status_flag = 'A'
      AND hpua.party_usage_code = 'SUPPLIER_CONTACT'
      AND (hpua.effective_end_date IS NULL OR hpua.effective_end_date > Sysdate);
Line: 3357

    SELECT item_key
    FROM wf_items
    WHERE item_key LIKE l_purge_item_key_type;
Line: 3364

  SELECT COUNT(APS.VENDOR_ID)
  into l_supplier_count
  FROM AP_SUPPLIERS APS
  WHERE
    Trunc(APS.BUS_CLASS_LAST_CERTIFIED_DATE) + To_Number(FND_PROFILE.Value('POS_BUS_CLASS_RECERT_PERIOD')) = Trunc(SYSDATE) + To_Number(FND_PROFILE.Value('POS_BUS_CLASS_RECERT_REMIND_DAYS'))
    OR
    ( Trunc(SYSDATE) > Trunc(APS.BUS_CLASS_LAST_CERTIFIED_DATE + To_Number(FND_PROFILE.Value('POS_BUS_CLASS_RECERT_PERIOD')))
      AND
      Mod ( To_Number(Trunc(SYSDATE) - Trunc(APS.BUS_CLASS_LAST_CERTIFIED_DATE)) - To_Number(FND_PROFILE.Value('POS_BUS_CLASS_RECERT_PERIOD'))
          ,To_Number(FND_PROFILE.Value('POS_BUS_CLASS_RECERT_REMIND_DAYS'))
          ) = 0
     )
     OR APS.BUS_CLASS_LAST_CERTIFIED_DATE IS NULL;
Line: 3448

          SELECT bus_class_last_certified_date
          INTO l_last_certification_date
          FROM ap_suppliers
          WHERE vendor_id = l_vendor_id;
Line: 3467

          select vendor_name
          into l_role_display_name
          from ap_suppliers
          where vendor_id = l_vendor_id;
Line: 3472

          select SYSDATE + To_Number(FND_PROFILE.Value('POS_BUS_CLASS_RECERT_REMIND_DAYS'))
          into l_expiration_date
          from ap_suppliers
          where vendor_id = l_vendor_id;