0% found this document useful (0 votes)
69 views

Oracle+DBMS PL - SQL Trigger

This document compares Microsoft Access and Oracle databases and provides information on PL/SQL, stored procedures, and triggers in Oracle. It discusses that Oracle can be used across different platforms while Access is only for Windows, that Oracle uses a full storage system while Access uses one file, and that Oracle is suited for enterprise-wide or internet-wide uses. It also outlines what PL/SQL is, how procedures and triggers are created and used in Oracle, and considerations for designing triggers and enforcing business rules in Oracle databases.

Uploaded by

angelwid
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
69 views

Oracle+DBMS PL - SQL Trigger

This document compares Microsoft Access and Oracle databases and provides information on PL/SQL, stored procedures, and triggers in Oracle. It discusses that Oracle can be used across different platforms while Access is only for Windows, that Oracle uses a full storage system while Access uses one file, and that Oracle is suited for enterprise-wide or internet-wide uses. It also outlines what PL/SQL is, how procedures and triggers are created and used in Oracle, and considerations for designing triggers and enforcing business rules in Oracle databases.

Uploaded by

angelwid
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 8

Oracle DBMS, PL/SQL, Trigger

Microsoft Access vs Oracle


• Access
- Windows platform only
- One file
- Mostly for a single user

• Oracle
- Windows, Unix, Linux
- Whole storage system
- Enterprise wide or internet wide uses
PL/SQL
• PL/SQL is Oracle’s Procedure Language
extension to SQL
• PL/SQL
- Block-structured
- Declare variables, constants
- Use control flows
- Handle exceptions
- Call Other PL/SQL Modules
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, salary decimal(7,2)) as
Update emp set sal=sal+salary where
ssn=essn;
End raiseSal;
/
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, we need to know
- events that trigger the rule
- conditions under which the trigger is to be executed
- actions to be taken when the trigger executes
• Triggers are not called by users
• Triggers are invoked by events
• Usually triggers are for insert, update and delete
operations
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
Design Considerations
• By using PL/SQL procedures, triggers, we
can set many constraints and force many
business rules
• General guideline
- for large systems, we prefer to write constraints into
middleware, reason: DBMS performance, Manageability
and portability
- for small to mid systems, we may put them to DBMS
• Oracle always wants you to use DB only

You might also like