Subject | Re: Functions/UDF's/Reserved Words in FB & IB6 |
---|---|
Author | Tony Masefield |
Post date | 2005-08-05T05:06:02Z |
--- In firebird-support@yahoogroups.com, Lester Caine <lester@l...>
wrote:
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,
wrote:
> Tony Masefield wrote:available
>
> > Is there an udated list on what functions/reserved words are
> > in FB?functions,
> > 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
> > keywords or UDF information in the IB 6 manuals as far as I cansee.
> > The same is true of the identical 'Today' which I see used insome of
> > the example code used in other documentation.was
> >
> > 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
> only a DATE field, which matches the Dialect 3 TIMESTAMP .Theyneed to
> be CAST to be used with Dialect 3 type fieldsalready
> i.e. CAST('NOW' AS TIMESTAMP)
>
> The more modern alternative are the SQL context variables
>
> CURRENT_DATE, CURRENT_TIME and CURRENT_TIMESTAMP, which are
> identified as DATE, TIME and TIMESTAMP values.will
>
> The only difference between NOW and CURRENT_TIMESTAMP is that NOW
> take the actual time from the clock at each use, whileCURRENT_TIMESTAMP
> is calculated at the start of the operation and will be the samefor all
> inserts in an operation.Thanks for the reply and link Lester,
>
> 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
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,