Oracle DBMS, PL/SQL, Trigger

Windows platform only .Whole storage system . Unix.Mostly for a single user ‡ Oracle .Microsoft Access vs Oracle ‡ Access .One file . Linux .Windows.Enterprise wide or internet wide uses .

Use control flows .Call Other PL/SQL Modules .Declare variables.Handle exceptions .Block-structured .PL/SQL ‡ PL/SQL is Oracle¶s Procedure Language extension to SQL ‡ PL/SQL . constants .

Procedures ‡ PL/SQL is usually used to program procedures ‡ Syntax Create or replace procedure<name>(list of parameters) as Declare option Begin Exception option End / .

Stored Procedure Example --modify the salary of a given employee Create or replace procedure raiseSal(essn varchar.2)) as Update emp set sal=sal+salary where ssn=essn. / . End raiseSal. salary decimal(7.

conditions under which the trigger is to be executed . update and delete operations .Triggers ‡ Trigger is special type of stored procedures that is executed automatically by the system as a side effect of a modification to the database ‡ To design a trigger.actions to be taken when the trigger executes ‡ Triggers are not called by users ‡ Triggers are invoked by events ‡ Usually triggers are for insert. we need to know .events that trigger the rule .

Trigger Format ‡ A trigger consists of the following components ‡ Trigger Name ‡ Trigger Time Point before/after ‡ Trigger Events insert or update or delete on table ‡ Trigger Type for each row ‡ Trigger Body .

Manageability and portability . we can set many constraints and force many business rules ‡ General guideline .for small to mid systems. we may put them to DBMS ‡ Oracle always wants you to use DB only .for large systems.Design Considerations ‡ By using PL/SQL procedures. we prefer to write constraints into middleware. triggers. reason: DBMS performance.