Welcome Guest. Sign in or Signup

1 Answers

%DateIn vs %DateOut

Asked by: 2924 views SQL

%DateIn vs %DateOut are meta-SQLs used in PeopleSoft. Compare between %DateIn and %DateOut.

Related Questions

1 Answers



  1. Candidate on Nov 26, 2012 Reply

    The code you write may end up running on a different platform than the one it was originally written for. As not all RDBMS have the same syntax for representing dates, these meta-SQLs are particularly helpful.

    When a date literal or a date bind variable is used within the WHERE clause of SELECT or UPDATE statements, it can be specified within the %DateIn meta-SQL variable to get the platform-specific SQL syntax for the date. In a similar way, it can also be used to pass a date in the INSERT statement.

    In short it converts the date literal / bind variable into the format which the DB uses.

    INSERT INTO PS_SGK_REC (EMPLID, NAME, JOIN_DT, DEPTID)
    VALUES (’001′, ‘John’, %DateIn(:1), ‘EAS’);

    %DateOut on the other hand converts a date column in the SELECT clause to the format that PeopleSoft uses.

    SELECT EMPLID, NAME, %DateOut(JOIN_DT)
    FROM PS_SGK_REC
    WHERE DEPTID = ‘EAS’;

    +1 Votes Thumb up 2 Votes Thumb down 1 Votes


Answer Question