SQL/MX 3.2 Reference Manual (H06.25+, J06.14+)

SQL/MX Language Elements
HP NonStop SQL/MX Release 3.2 Reference Manual691117-001
6-112
Triggers
An SQL/MX table is described in an SQL/MX schema and stored in a physical file in
the Guardian environment. An SQL/MX table name can be a fully qualified ANSI name
of the form catalog-name.schema-name.object-name.
Base Tables and Views
In some descriptions of SQL, tables created with a CREATE TABLE statement are
referred to as base tables to distinguish them from views, which are referred to as
logical tables.
A view is a named logical table defined by a query specification that uses one or more
base tables or other views. See Views on page 6-112.
Example of a Base Table
For example, this EMPLOYEE table is a base table in the sample database:
In this sample table, the columns are EMPNUM, FIRST_NAME, LAST_NAME,
DEPTNUM, JOBCODE, and SALARY. The values in each column have the same data
type.
See Tables in the SQL/MP Reference Manual.
Triggers
A trigger is a mechanism that resides in the database and specifies that when a
particular action—an insert, delete, or update—occurs on a particular table,
NonStop SQL/MX should automatically perform one or more additional actions.
Triggers are not allowed on SQL/MP aliases.
For a complete description of triggers and their use, see Considerations for CREATE
TRIGGER on page 2-134. See also CREATE TRIGGER Statement on page 2-132,
ALTER TRIGGER Statement
on page 2-40, DROP TRIGGER Statement on
page 2-174, SET Statement
on page 2-290, and SIGNAL SQLSTATE Statement on
page 2-306.
Views
A view provides an alternate way of looking at data in one or more tables. A view is a
named specification of a result table, which is a set of rows selected or generated from
EMPNUM FIRST_NAME LAST_NAME DEPTNUM JOBCODE SALARY
1 ROGER GREEN 9000 100 175500.00
23 JERRY HOWARD 1000 100 137000.00
75 TIM WALKER 3000 300 32000.00
. . . . . . . . . . . . . . . . . .