Skip to Main Content
Return to Navigation

Meta-SQL

You can write SQL within Application Engine, or you can copy SQL statements into Application Engine from any SQL utility with few, if any, changes. This capability enables you to write and fine tune SQL statements before you try to incorporate them into an Application Engine program.

Database platforms can have different syntax rules, especially in regard to date, time, and other numeric calculations. Generally, you can work around syntax differences using PeopleSoft meta-SQL, which Application Engine supports. Meta-SQL is a set of predefined terms (meta-strings) designed to replace relational database management system (RDBMS)-specific SQL syntax with a common syntax.

In addition, PeopleSoft meta-SQL enables you to dynamically generate portions of SQL code. For example, to join two tables based on their common keys, use the following meta-string:

%Join(COMMON_KEYS, PSAESECTDEFN ABC,  PSAESTEPDEFN XYZ ) 

At runtime, the function would be expanded into the following:

ABC.AE_APPLID = XYZ.AE_APPLID 
AND ABC.AE_SECTION = XYZ.AE_SECTION
AND ABC.DBTYPE = XYZ.DBTYPE 
AND ABC.EFFDT = XYZ.EFFDT