3GL Access to Database Schema Triggers

Database schema triggers are 4GL procedures that Progress invokes automatically when it performs database operations such as row updates, creates, and deletes. They are stored in the database independently from application logic and respond equally to all applications that access the database. For more information on schema triggers, see the Progress Programming Handbook.

If you access a Progress database via ESQL, database schema triggers execute appropriately. For example, the DELETE statement executes the DELETE trigger and the INSERT statement executes the CREATE trigger.

However, ESQL applications that execute database schema triggers cannot compile the trigger procedure 4GL code; you must compile all schema trigger procedures prior to running your ESQL application. Also, ESQL applications cannot execute schema triggers that contain certain invalid 4GL keywords.

Invalid 4GL Keywords

An ESQL application cannot execute a schema trigger that executes 4GL user interface and operating system I/O operations. If ESQL tries to execute such a schema trigger, it generates an error message at the SQL statement that caused the trigger to execute and sets the ESQL error variables to the default error codes: SQLCODE to -1; SQLSTATE to 50000. (For more information on SQLCODE and SQLSTATE, see the section "Error Handling.") The error message identifies the trigger name and the line number within the trigger procedure that contains the invalid keyword.

Table 2–3 lists the 4GL keywords that are invalid in schema triggers executed by ESQL applications.

Table 2–3: Invalid 4GL Keywords in ESQL Schema Triggers  
ALIAS
ENABLE
READKEY
APPLY
HIDE
SCROLL
BELL
IMPORT
SEARCH
CHOOSE
INPUT
SEEK
CLEAR
KEY-VALUE
SET
CLOSE
LOAD
STATUS
COMPILE
NEXT-PROMPT
SYSTEM-DIALOG
CONNECT
ON
UNDERLINE
CREATE widget
OS escapes
UNLOAD
DDE
OUTPUT
UP
DELETE widget
PAGE
UPDATE
DISABLE
PAUSE
VIEW
DISCONNECT
PROMPT-FOR
WAIT-FOR
DISPLAY
PUT
DOWN
PUT-VALUE

Large Client Applications and Host Language Call Functions

For ESQL large client applications, schema triggers can use the Host Language Call (HLC) interface. When you use the CALL statement to execute 3GL functions in a schema trigger executed by an ESQL large client application, the following HLC functions are disabled:

However, you can use the HLC promsgd() function to add messages to the list of messages returned by the ESQL sqlgetmsg() function. For more information on HLC and HLC functions, see the Progress External Program Interfaces manual.


Copyright © 2004 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095