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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

$$DBDATETIME$$ system variable<br />

Syntax<br />

$$DBDATETIME$$<br />

Description<br />

$$DBDATETIME$$ retrieves the current date and time from the local database. Use<br />

$$DBDATETIME$$ to designate a default value or range for a text item using the Initial Value or<br />

Lowest/Highest Allowed Value properties. The text item must be of the CHAR or DATETIME data<br />

type.<br />

Usage Notes<br />

Use $$DBDATETIME$$ to default a DATE item to the current date on the server machine, for example,<br />

when connecting to a remote database that may be in a different time zone from the client’s time zone.<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, if you want a DD-MON-YY HH:MM:SS format, you must specify a<br />

DATETIME or CHAR data type. (Note that the default format mask depends on the value of<br />

NLS_LANG.)<br />

If you are building a client/server application, using $$DBDATETIME$$ could have performance<br />

implications, depending on the complexity of your network configuration.<br />

Note: Do not use $$DBDATETIME$$ instead of $$DBDATE$$ unless you plan to specify the time<br />

component. If, for example, you use $$DBDATETIME$$ with the default DATE format mask of DD-<br />

MON-YY, you would be committing values to the database that the user would not see, because the<br />

format mask does not include a time component. Then, because you had committed specific time<br />

information, when you later queried on date, the values would not match and you would not return any<br />

rows.<br />

$$DBDATETIME$$ restrictions<br />

If you are accessing a non-ORACLE datasource, avoid using $$DBDATETIME$$. Instead, use a<br />

When-Create-Record trigger to select the current date and time in a datasource-specific manner.<br />

$$DBDATETIME$$ examples<br />

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

current database date and time. When you define the ORDERDATE text item, specify<br />

$$DBDATETIME$$ in the Lowest/Highest Allowed Value properties.<br />

371

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

Saved successfully!

Ooh no, something went wrong!