A very useful PeopleCode Meta-SQL function.Below is an example on how %CurrentDateIn function will be resolved at run time.

The %CurrentDateIn meta-SQL variable expands to a platform-specific SQL
substring representing the current date in the Where clause of a SQL
Select or Update statement, or when the current date is passed in an
Insert statement.

And here is an example:

SELECT ‘X’
FROM dual
WHERE sysdate > %CurrentDateIn;

At run time, the SQL above will be resolved to look like this:

SELECT ‘X’
FROM dual
WHERE sysdate > To_Date(To_Char(SYSDATE, ‘YYYY-MM-DD’), ‘YYYY-MM-DD’);

This will also improve performance of a object at run time.

Advertisements