%Execute meta-SQL element
Syntax
%Execute([/])command1{; |
/}command2{; | /}...commandN{; | /}
Description
Use the %Execute function to execute database-specific commands from within your Application Engine program. Also, the %Execute function enables you to include multiple statements in a single Application Engine action without encountering database-specific differences. For instance, in some instances you could code a single Application Engine action to contain multiple SQL statements, and they might run successfully on one database platform. However, if you attempt to run the same code against a different database platform, you might encounter errors or skipped SQL.
By default, Application Engine expects a semicolon to be used to delimit multiple commands within an %Execute function statement. You can instruct Application Engine to use a forward slash (/) delimiter instead by placing a forward slash inside the function parentheses.
Note:
When you use the %Execute function, it must be located at the beginning of the statement and must be the only function or command contained in the statement. The action type must be SQL.
Note:
No comment statement should be used in a SQL code when using %Execute.
Example
The following code enables you to use an Oracle PL/SQL block in an %Execute statement:
%Execute(/)
DECLARE
counter INTEGER;
BEGIN
FOR counter := 1 TO 10
UPDATE pslock SET version = version + 1;
END FOR;
END;
/