Friday, January 20, 2006
Tip of the Day: Using R:BASE System Variables
Versions: R:BASE 7.5 and V-8 Turbo for Windows
Build: 7.5.24.30120 or higher ...
Did you know that in addition to #DATE, #TIME, #PI,
SQLCODE, and SQLSTATE, now you also have an
additional #NOW system variable?
An additional #NOW variable (current date and time)
has been implemented in the latest update of R:BASE
7.5 and V-8 Turbo for Windows!
Example 01:
SHOW VARIABLES
Among other system variables, such as #DATE, #TIME
and #PI, SQLCODE, and SQLSTATE, #NOW will also be
included when using the SHOW VARIABLES command at
the R> prompt.
Example 02:
SET VAR vCurrentDateTime = .#NOW
The resulting variable vCurrentDateTime will return
current date time with DATETIME data type.
Example 03:
UPDATE tablename SET datetimecolname = .#NOW WHERE ...
Will update the datetimecolname with DATETIME data
type with current date and time value.
Example 04:
INSERT INTO tablename (colname1, Colname2, Colname3) +
VALUES .vColumnValue1, .vColumnValue2, .#NOW
Imagine the possibilities!
Very Best R:egards,
Razzak.