O slideshow foi denunciado.
Utilizamos seu perfil e dados de atividades no LinkedIn para personalizar e exibir anúncios mais relevantes. Altere suas preferências de anúncios quando desejar.

Oracle Forms Triggers

1.152 visualizações

Publicada em

Oracle Form Triggers

Publicada em: Software
  • Seja o primeiro a comentar

Oracle Forms Triggers

  1. 1. Item Interaction Triggers http://ebiztechnics.blogspot.com
  2. 2. Objectives • Adding Functionality to Input and Non-input Items by adding triggers and Built-ins. • Displaying LOVs from Buttons • Interacting with Checkboxes • Interacting with Radio Buttons • Interacting with List items • Loading Image into Image item • Populating Hierarchical Tree Item http://ebiztechnics.blogspot.com
  3. 3. Item interaction Trigger • Valid commands: – SELECT statements – PL/SQL expressions – All built-in subprograms – User Defined Subprograms http://ebiztechnics.blogspot.com
  4. 4. Examples When-Button-Pressed When-Checkbox-Changed When-Radio-Changed When-List-Changed When-List-Activated When-Image-Pressed When-Image-Activated When-Tree-Node-Selected http://ebiztechnics.blogspot.com
  5. 5. Displaying LOVs from Buttons • Uses: – Convenient alternative for accessing LOVs – Can display independently of text items • Needs: – When-Button-Pressed trigger – LIST_VALUES or SHOW_LOV built-in DECLARE x Boolean; BEGIN x:=SHOW_LOV(‘Dept_Lov’); END; http://ebiztechnics.blogspot.com
  6. 6. Interacting With Checkboxes • WHEN-CHECKBOX-CHANGED trigger IF CHECKBOX_CHECKED(‘Control.case’) THEN SET_ITEM_PROPERTY(‘Emp.ename’,CASE_INSENSITIVE_QUERY, PROPERTY_FALSE); ELSE SET_ITEM_PROPERTY('Emp.ename',CASE_INSENSITIVE_QUERY, PROPERTY_TRUE); END IF; http://ebiztechnics.blogspot.com
  7. 7. Interacting With Radio Button • WHEN-RADIO-CHANGED trigger IF :emp.job=‘MANAGER’ THEN :emp.sal:=7000; ELSIF :emp.job=‘CLERK’ THEN :emp.sal:=5000; ELSE :emp.sal:=2000; END IF; http://ebiztechnics.blogspot.com
  8. 8. Interacting with List Items ADD_LIST_ELEMENT(‘emp.job’, 4, ‘Analyst’, ‘ANALYST’); DELETE_LIST_ELEMENT(‘emp.job’ 2); President Manager Clerk Salesman Index 1 2 3 http://ebiztechnics.blogspot.com
  9. 9. Loading Images Fetch on Query READ_IMAGE_FILE WRITE_IMAGE_FILE http://ebiztechnics.blogspot.com
  10. 10. Read_Image_File Built-in • Used to Load Images into Image Items. READ_IMAGE_FILE(‘E_’||:emp.empno||’.bmp’, ’BMP’, ’emp.emp_image’); http://ebiztechnics.blogspot.com
  11. 11. Populating Hierarchical Tree Item • Set the Data Query Property – SELECT 1,level,ename,null,empno FROM emp CONNECT BY PRIOR empno=mgr START WITH JOB=‘PRESIDENT’ Note: Do not terminate query with semicolon. • Write When-New Form Instance Trigger at Form Level Ftree.Populate_Tree(‘tree_block.emp_tree’); http://ebiztechnics.blogspot.com
  12. 12. Summary • Item Interaction Triggers and Built-ins • Interacting with Various Items – Push Button – Checkbox – Radio Button – List Item – Image Item – Hierarchical Tree Item http://ebiztechnics.blogspot.com

×