Subject | Re: [firebird-support] Context variables |
---|---|
Author | Nick Upson |
Post date | 2005-03-14T12:11:32Z |
In article <007201c5288a$5329e6a0$0c0110ac@prenosil>, Ivan Prenosil wrote:
same
portion (varchar 11) and then making it into a date again
--
Nick
-----We Solve your Computer Problems---
Founder & Listowner of the Prolifics User Group
Panther, Ingres, UNIX, Interbase, Firebird - Available Shortly
> > Am I correct in thinking that these are equivalent line of code (given bothThanks for the response:
> > 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),I understand that in dialect 3 but in dialect 1 I thought they would produce the
> the second one just date.
same
> * First one is evaluated only once for each statement,understood
> the second one everytime the expression is evaluated.
> * 'NOW' is CHAR(3) string, there is no reason to cast it to VARCHAR(11).for dialect 1, I thought I was getting the date (NOW), chopping off the time
> This is enough:
> dt2 = CAST('NOW' as DATE);
portion (varchar 11) and then making it into a date again
--
Nick
-----We Solve your Computer Problems---
Founder & Listowner of the Prolifics User Group
Panther, Ingres, UNIX, Interbase, Firebird - Available Shortly