%CurrentDateIn Meta-SQL Function

No votes yet

A very useful PeopleCode Meta-SQL function. I will be providing an
example and how %CurrentDateIn function will be resolved at run time.
But first, this is how PeopleSoft explains it:

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');

Please try to help out with unanswered topics on the forum. Chances are you have had the same issue/question some time in your IT career!

Comments

Have a question? Please ask it on the forum instead.

Post new comment

The content of this field is kept private and will not be shown publicly.
CAPTCHA
The question below is to prevent automated spam submissions.
Image CAPTCHA
Enter the characters shown in the image.