03.10.2011 20:05, Paul Vinkenoog wrote:
>
> CURRENT_DATE
> When you add this one, you might also want to make CURRENT_DATE a link in the 
> first listitem under Notes in the 'NOW' section, given that CURRENT_TIME and 
> CURRENT_TIMESTAMP are also links. The links in the second listitem can be 
> removed for all I care (not the words themselves, just the<link>  elements 
> around them).
>
> USER - I think it's a full synonym/alias of CURRENT_USER. Dmitry will know. 
> If so, then you can just refer to CURRENT_USER (just like SOME in the 
> LangRefUpd refers to ANY). If there are differences, they should be 
> documented.

They're full synonyms.

> 'YESTERDAY', 'TODAY' and 'TOMORROW'
> These are not context variables, but serve the same purpose. See 'NOW', which 
> is also documented under Context variables (quotes and all).

They can behave as either literals substituted immediately (timestamp 
'today') or as context variables (cast('today' as timestamp)). Quite 
weird and perhaps even annoying, I know.

> One difference is that 'NOW' can be cast to any date/time type, and these 
> three only to DATE and TIMESTAMP.

Not completely true:

time 'today' -- error
cast(timestamp 'today' as time) -- 00:00:00.0000

In this regard, I don't like referring to date/time/timestamp keywords 
prior to a string as to "shorthand casts". In fact, it's the only 
syntactically correct way to specify a date/time literal. Numerics can 
be represented normally, strings are enclosed in quotes, but there's 
nothing for dates/times. So the ANSI committee has invented a special 
prefix (data type name was used) following by the string literal which 
is treated as a date/time literal in this case. So it's a part of the 
language grammar rather than some operation. That said, it does really 
work like a cast, so I don't know how to document it properly :-) 
Especially considering 'NOW' etc that do work like a function.

> Any more missing...? Dmitry?

Nothing I'm aware of.


Dmitry

------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2dcopy1
_______________________________________________
Firebird-docs mailing list
Firebird-docs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/firebird-docs

Reply via email to