Subject | Re: [firebird-support] Functions/UDF's/Reserved Words in FB & IB6 |
---|---|
Author | Lester Caine |
Post date | 2005-08-04T07:45:48Z |
Tony Masefield wrote:
NOW, YESTERDAY, TODAY, TOMORROW
These are legacy from dialect 1 versions of Interbase, where there was
only a DATE field, which matches the Dialect 3 TIMESTAMP .They need to
be CAST to be used with Dialect 3 type fields
i.e. CAST('NOW' AS TIMESTAMP)
The more modern alternative are the SQL context variables
CURRENT_DATE, CURRENT_TIME and CURRENT_TIMESTAMP, which are already
identified as DATE, TIME and TIMESTAMP values.
The only difference between NOW and CURRENT_TIMESTAMP is that NOW will
take the actual time from the clock at each use, while CURRENT_TIMESTAMP
is calculated at the start of the operation and will be the same for all
inserts in an operation.
As from FB2 milliseconds will be provided as part of NOW and
CURRENT_TIMESTAMP.
Online link
http://home.lsces.co.uk/tikifirebird/wiki/index.php?page=NOW
Any additional contributions more than welcome !!!
--
Lester Caine
-----------------------------
L.S.Caine Electronic Services
> Is there an udated list on what functions/reserved words are available'NOW' is one of the predefined literals
> in FB?
> Trying to find this information is proving frustrating.
> For instance, the IB 6 'Language Reference' manual uses the
> function 'Now' to insert a date into field ('NEW/OLD' context
> variables) - but there is no mention of 'Now' in the sql functions,
> keywords or UDF information in the IB 6 manuals as far as I can see.
> The same is true of the identical 'Today' which I see used in some of
> the example code used in other documentation.
>
> Any online references would be appreciated.
NOW, YESTERDAY, TODAY, TOMORROW
These are legacy from dialect 1 versions of Interbase, where there was
only a DATE field, which matches the Dialect 3 TIMESTAMP .They need to
be CAST to be used with Dialect 3 type fields
i.e. CAST('NOW' AS TIMESTAMP)
The more modern alternative are the SQL context variables
CURRENT_DATE, CURRENT_TIME and CURRENT_TIMESTAMP, which are already
identified as DATE, TIME and TIMESTAMP values.
The only difference between NOW and CURRENT_TIMESTAMP is that NOW will
take the actual time from the clock at each use, while CURRENT_TIMESTAMP
is calculated at the start of the operation and will be the same for all
inserts in an operation.
As from FB2 milliseconds will be provided as part of NOW and
CURRENT_TIMESTAMP.
Online link
http://home.lsces.co.uk/tikifirebird/wiki/index.php?page=NOW
Any additional contributions more than welcome !!!
--
Lester Caine
-----------------------------
L.S.Caine Electronic Services