Popular Posts

Tuesday, July 28, 2020

How to Define Global Table Types in Forms to be accessed across different triggers



If you want to populate the Table Type variables and access the table types in other triggers then you have to define the Global Table Type in Program units Packages of the form.

(PKG)Package Specification definition:

TYPE gtyp_max_grp_data IS TABLE OF NUMBER  INDEX BY VARCHAR2 ( 100 );

(PKG)Package Body Definition:

CURSOR C1 IS select max(emp_id) from EMP where deptno=100;

BEGIN
   FOR REC1 IN C1 LOOP

--REC1 .emp_name||REC1.EMP_ID-- it is the unique index (i) of the array variable like 
    gt_cache_max_grp_data(i)
     gt_cache_max_grp_data( REC1 .emp_name||REC1.EMP_ID) := REC1.emp_id;

END LOOP;

END;

How to access this table type in another trigger?

l_max_emp_id  :=  PKG.gt_cache_max_grp_data ( :blk_emp.emp_name|| PKG.g_cahched_value_delimiter || :blk_emp.emp_id );


Now the variable l_max_emp_id contains the maximum group id that was populated in the program unit package and now that value we are able to access in when-checkbox-changed trigger or any other trigger

No comments:

 How to direct the outputfile of the concurrent request to unix server path using XMLP Bursting  ORACLE APPS. Step 1: In the DATA XML defini...