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.
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 ESQLsqlgetmsg()
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 |