Subject Re: [firebird-support] Context variables
Author Ivan Prenosil
> Am I correct in thinking that these are equivalent line of code (given both
> dt1 & dt2 are defined as date (dialect1) and timestamp (dialect3):
>
> dt1 = CURRENT_TIMESTAMP;
>
> dt2 = CAST(CAST ('NOW' AS VARCHAR(11)) as DATE);

No.

* First one will return timestamp (i.e. date+time),
the second one just date.

* First one is evaluated only once for each statement,
the second one everytime the expression is evaluated.

* 'NOW' is CHAR(3) string, there is no reason to cast it to VARCHAR(11).
This is enough:
dt2 = CAST('NOW' as DATE);

Ivan
http://www.volny.cz/iprenosil/interbase/