11.01.2013 Views

Oracle Forms Developer – Form Builder Reference, Volume 1

Oracle Forms Developer – Form Builder Reference, Volume 1

Oracle Forms Developer – Form Builder Reference, Volume 1

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

$$DATE$$ system variable<br />

Syntax<br />

$$DATE$$<br />

Description<br />

$$DATE$$ retrieves the current operating system date (client-side). Use $$DATE$$ to designate a<br />

default value or range for a text item using the Initial Value or Lowest/Highest Allowed Value<br />

properties. The text item must be of the CHAR, DATE, or DATETIME data type.<br />

Use $$DATE$$ as a default value for form parameters. In this case, the parameter’s value is computed<br />

once, at form startup.<br />

Usage Notes<br />

The difference between $$DATE$$ and $$DATETIME$$ is that the time component for $$DATE$$ is<br />

always fixed to 00:00:00, compared to $$DATETIME$$, which includes a meaningful time component,<br />

such as 09:17:59.<br />

The display of system variables is governed by the format mask, either a default data type format mask or<br />

one you specify. For example, to use the default DD-MON-YY format, specify a DATE data type.<br />

(Note that the default format mask depends on the value of NLS_LANG.)<br />

Although $$DATE$$ displays only the date, its underlying value includes a time component which is<br />

saved at commit time. If you specify a DATETIME data type and provide $$DATE$$ as the default, the<br />

underlying value will be DD-MON-YYYY HH:MM:SS: for example, 01-DEC-1994 00:00:00 (although<br />

only 01-DEC-1994 will be displayed).<br />

Use $$DATE$$ when you want to compare the contents of this field with a field whose format mask<br />

does not have a time component, such as a SHIPDATE field of data type DATE. In this case, both<br />

$$DATE$$ and SHIPDATE will have a time component of 00:00:00, so the comparison of two dates<br />

evaluating to the same day will be successful.<br />

$$DATE$$ examples<br />

Example 1<br />

Assume that you want the value of a DATE text item, called ORDERDATE, to default to the current<br />

date. When you define the ORDERDATE text item, specify $$DATE$$ in the text item Initial Value<br />

property.<br />

Example 2<br />

If you use $$DATE$$ in a parameter, such as :PARAMETER.STARTUP_DATE, then every time you<br />

reference that parameter, the date you started the application will be available:<br />

IF :PARAMETER.Startup_Date + 1 < :System.Current_Datetime<br />

THEN Message (’You have been logged on for more than a<br />

day.’);<br />

ELSE Message (’You just logged on today.’);<br />

END IF;<br />

368

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!