Subject Re: Functions/UDF's/Reserved Words in FB & IB6
Author Tony Masefield
--- In firebird-support@yahoogroups.com, Lester Caine <lester@l...>
wrote:
> Tony Masefield wrote:
>
> > Is there an udated list on what functions/reserved words are
available
> > 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' is one of the predefined literals
>
> 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

Thanks for the reply and link Lester,
Using the IB 6 beta documents one has to carefully read all
references. I'll leave you with an example from the Embedded SQL
Guide:
Page 111
Date Literals - String values that can be entered in
quotes ....Possible strings are 'Today', 'Now', 'Yesterday'
and 'Tomorrow'.
Page 189
Interbase supports five date
literals, 'Timestamp', 'Date', 'Time' 'Yesterday' and 'Tomorrow'.....

Yes, I know they are beta documents but as a Newbie to FB, and these
being, more or less, the reference documents it can be confusing!
However reading these paragraphs in context to the information you
have supplied makes more sense.

Rgds,