%DateIn meta-SQL element

Syntax

%DateIn(dt)

Description

The %DateIn meta-SQL variable expands into platform-specific SQL syntax for the date. Use %DateIn whenever a date literal or Date bind variable is used in a comparison in the Where clause of a Select or Update statement, or when a Date value is passed in an Insert statement.

Parameters

Parameter Description

dt

Specify either a Date value or a date literal in YYYY-MM-DD format.

Restrictions Using COBOL

You can only use string literals when using this construct in COBOL. You cannot use it with bind parameters in COBOL. For example, the following works in COBOL:

UPDATE PS_PERSONAL_DATA SET LASTUPDT = %DATEIN('2002-12-11')

The following SQL fails:

UPDATE PS_PERSONAL_DATA SET LASTUPDT = %DATEIN(:1)