O'Reilly logo

Beginning Oracle® Application Express by Paul Turley, Chris Leiter, Dan Wood

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

8.3. Server-Side PL/SQL

As mentioned at the beginning of this chapter and throughout this book, PL/SQL is the procedural language used in the Oracle database, and the applications you create with APEX are materialized with PL/SQL code. This code can be thought of as application-side code, in that the code responds to application side interactions.

However, you can also use PL/SQL code to implement triggers, which respond to database activities. A trigger is fired when the data is inserted, updated, or deleted from the database, and triggers fire either before or after these events.

The Oracle database also supports INSTEAD OF triggers, which, as their name implies, are used instead of database actions. This type of trigger is used less commonly than INSERT, UPDATE, and DELETE triggers, and are beyond the scope of this book.

If you are a developer, you are probably already familiar with the distinction between application code and server code, but the distinction between PL/SQL in APEX and in the database is a little less clear. For instance, application code typically runs on a client machine, while PL/SQL application code used by APEX still runs in the Oracle database. And PL/SQL code that runs as part of an APEX application has a slightly different syntax than PL/SQL database triggers, as you will soon see.

But there are still times when it makes more sense to use database triggers than PL/SQL APEX triggers.

8.3.1. Problem Statement and Solution Location

You have already ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required