Total Pageviews

Monday, 12 October 2020

PLSQL: CONTEXT

 -------set context---

EXEC XX_OM_CTX_SET_PKG.pr_set_sun_ctx('P_CUST_GRP_ACC_NUM','415');


EXEC XX_OM_CTX_SET_PKG.pr_set_sun_ctx('P_CUST_ACC_NUM','430');


----retrive context value---------

SELECT SYS_CONTEXT('XX_OM_CTX_CON','P_CUSTOMER_ID')

FROM   dual;


---how to create syntax

CREATE OR REPLACE CONTEXT XX_OM_CTX_CON

 USING APPS.XX_OM_CTX_SET_PKG;


CREATE OR REPLACE PACKAGE BODY APPS.xx_om_ctx_set_pkg

AS

   PROCEDURE pr_set_sun_ctx (p_attrib varchar2, p_value varchar2)

   IS

   BEGIN

      DBMS_SESSION.set_context ('XX_OM_CTX_CON', p_attrib, p_value);

   END pr_set_sun_ctx;


   PROCEDURE pr_clear_sun_ctx (p_attrib varchar2)

   IS

   BEGIN

      DBMS_SESSION.clear_context ('XX_OM_CTX_CON', p_attrib);

   END pr_clear_sun_ctx;

END xx_om_ctx_set_pkg;

/

No comments:

Post a Comment

FUSION: Purchasing Query

  1) ---------CPA to PO Amount---------- select poh.segment1, (select sum(nvl(cpol.quantity,1)* cpol.unit_price) from po_headers_all cpoh,po...