PeopleTools Reference: Meta-SQL DateIn/DateOut

DateIn

Description

Converts a date into the form the database uses.
Used for:

  • Where clauses
  • Insert/Update

Remember DateIn passes a date into the database.

DateOut

Description

Converts a date into the form that PeopleTools uses.
Used for:

  • Select clause

Examples

SELECT %DateOut(MAX(EFFDT))
FROM PS_JOB
WHERE EMPLID = :1
AND EMPL_RCD = :2
AND EFFDT

INSERT INTO PS_MY_RNCTL(OPRID, RUN_CONTROL_ID, AS_OF_DATE)
VALUES(:1, :2, %DateIn(:3))

UPDATE PS_MY_TABLE
SET MY_DATE = %DateIn(:1)
WHERE MY_DATE

2 thoughts on “PeopleTools Reference: Meta-SQL DateIn/DateOut

  1. I have a SQL preprocessor that evaluates the SQL right before it passes it to the database.  Currently, the only thing it does is to pull the semi-colon off of the end.  But, I plan to have it resolve meta-sql such as %Table() and %CurrentDateIn, etc.

    1. That’s pretty cool. Where is the SQL preprocessor at? Is it in an app or some sort of trigger in the database?

      I kind of did the same thing with a Java app I’ve been toying with using instead of SQL Developer. It looks for %tokens and evaluates them before running the SQL in the database. I think, right now, I only have %CurrentDateIn working.

Leave a Comment

Your email address will not be published. Required fields are marked *