Consultor Eletrônico



Kbase 19046: Can 4GL Programs Be Run From SQL-92 Clients or Vice Versa?
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   25/09/2006
Status: Verified

GOAL:

Can 4GL Programs Be Run From SQL-92 Clients or Vice Versa?

GOAL:

Why can not the 4GL schema triggers, and SQL-92 triggers be combined?

FIX:

As part of the SQL-92 implementation, stored procedures and (server-side) schema triggers have been implemented within the Progress V9 database. This Solution discusses the usage of 4GL schema triggers as compared to the SQL-92 schema triggers and stored procedures. It explains also why these 4GL schema triggers, and SQL-92 triggers and stored procedures cannot be combined.

SQL-92 Stored procedures are common procedures that are saved in the database for all SQL-92 clients to execute.

SQL-92 Triggers are triggers that are fired when certain database events occur. These also are stored in the database.

SQL-92 Stored procedures and triggers are Java routines that are executed by SQL-92 server processes. For more information, refer to the SQL-92 Guide and Reference, Chapter 4 "Java Stored Procedures and Triggers"

4GL schema triggers are also fired when certain database events occur. 4GL triggers are not stored in the database, only the names of the trigger programs are stored.

4GL schema triggers are Progress programs. The execution of a Progress program is via the Progress 4GL runtime engine, within a Progress client process (a 4GL client, AppServer or WebSpeed client).

SQL-92 triggers and stored procedures are executed within the SQL-92 server, in a Java Virtual Machine (JVM). These two execution paths are completely separate. The 4GL engine does not have a JVM built into it, and the SQL-92 engine does not have a 4GL engine built into it. There is no way to make a SQL-92 trigger or stored procedure execute a 4GL program. Consequently, there is no way for a 4GL trigger or program to execute a SQL-92 trigger or stored procedure.

This means that for standard Progress tables (i.e. in the PUB schema), it is possible to have two sets of triggers: one for the 4GL clients, and one for the SQL-92 clients. To have them both perform the same functionality, you will have to write equivalent code for each. The trigger that is fired will depend on which client you are using: SQL-92 clients will fire the SQL-92 triggers, the 4GL clients will fire the 4GL triggers.

The only recommended way of having the same business logic performed regardless of the client is to use the Open Client technology with AppServer. With the AppServer, the 4GL triggers and programs will be executed, as the eventual connection to the database will be via a 4GL client. For more information on using the AppServer, please refer to, "Building Distributed Applications Using the Progress AppServer".