DBA Data[Home] [Help]

APPS.POS_SPM_WF_PKG1 SQL Statements

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

Line: 69

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

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

       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: 233

        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: 238

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

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

     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: 372

	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: 533

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: 550

END notify_addr_updated;
Line: 555

	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: 690

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

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

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: 737

END notify_bus_class_updated;
Line: 742

	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: 900

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: 911

END notify_contact_updated;
Line: 1177

        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: 1219

        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: 1244

        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: 1256

        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: 1450

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

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

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

        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: 1812

	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: 1908

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

           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: 2080

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

     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: 2408

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: 2437

   l_process := 'PACCOUNT_UPDATED';
Line: 2505

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

END notify_account_update;
Line: 2510

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: 2539

   l_process := 'PACCT_BUYER_UPDATE';
Line: 2608

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

END notify_buyer_update_account;
Line: 2954

	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: 3027

	SELECT psr.reg_key, pcr.first_name, pcr.last_name, pcr.email_address, psr.supplier_name
	  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: 3137

  	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: 3181

   SELECT USER_NAME INTO L_FROM_NAME FROM FND_USER WHERE USER_ID=FND_GLOBAL.USER_ID;
Line: 3517

    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
      )
      and
      (
        (aps.start_date_active IS NULL OR aps.start_date_active <= SYSDATE) and
        (aps.end_date_active IS NULL OR aps.end_date_active >= SYSDATE) AND
        (aps.vendor_type_lookup_code IS NULL OR aps.vendor_type_lookup_code <> 'EMPLOYEE')
      );
Line: 3540

    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 OR fu.end_date >= SYSDATE)                     /* bug 8647019 */
      AND Nvl(fu.end_date, SYSDATE) >= sysdate
      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)               /* bug 8647019 */
      --AND (hzr.end_date IS NULL OR hzr.end_date >= Sysdate)
      AND Nvl(hzr.end_date, SYSDATE) >= 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);     /* bug 8647019 */
Line: 3568

    SELECT item_key
    FROM wf_items
    WHERE item_key LIKE l_purge_item_key_type
    and item_type like l_itemtype;
Line: 3579

/*    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
      )
      and
      (
        (aps.start_date_active IS NULL OR aps.start_date_active <= SYSDATE) and
        (aps.end_date_active IS NULL OR aps.end_date_active >= SYSDATE) AND
        (aps.vendor_type_lookup_code IS NULL OR aps.vendor_type_lookup_code <> 'EMPLOYEE')
      );
Line: 3672

          SELECT bus_class_last_certified_date, vendor_name, SYSDATE + To_Number(FND_PROFILE.Value('POS_BUS_CLASS_RECERT_REMIND_DAYS'))
          INTO l_last_certification_date, l_role_display_name, l_expiration_date
          FROM ap_suppliers
          WHERE vendor_id = l_vendor_id;
Line: 3691

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

          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;
Line: 3722

	l_users.delete;