Data Block Based On Procedures
Using a Stored Procedure with Forms This sample demonstrates how a block can be based on stored procedures. This feature can be implemented in two ways: 1- A REF CURSOR 2- A PL/SQL table In addition to that, there are also two different locations where to implement this functionality: 1- The ON-xxx triggers 2- The transactionnal triggers In this sample uses a REF CURSOR with the ON-xxx triggers Step1: Create a table named Bonus CREATE TABLE BONUS ( EMPNO NUMBER PRIMARY KEY, ENAME VARCHAR2(50), JOB VARCHAR2(20), SAL NUMBER, COMM NUMBER ); Step2: Create a package spec at the database level create or replace PACKAGE bonus_pkg IS TYPE bonus_rec IS RECORD ( empno bonus.empno%TYPE, ename bonus.ename%TYPE, job bonus.job%TYPE, sal bonus.sal%TYPE, comm bonus.comm%TYPE ); TYPE b_cursor IS REF CURSOR RETURN bonus_rec; -- Statement below needed if block is based on Table of Records TYPE bontab IS TABLE OF bonus_rec INDEX BY BINARY_INTEGER; -- Statement below needed if using Ref Cursor PROCEDURE bo...
تعليقات
إرسال تعليق