04.10.2011 2:19, Paul Vinkenoog wrote: > However, I just had a surprise: within a PSQL module, "timestamp 'now'" and > "date 'today'" stayed the same throughout the execution (I built in a delay > loop and made sure the system day changed while the module ran). > > What's more: in a prepared statement - an EXECUTE BLOCK with a counter as > input param - those values stayed the same even if I re-executed the block > minutes later, regardless whether I changed the input param or not. Now > *that*'s some caching! ;-) > > I don't know if this _always_ happens with shorthand casts or if it is an > optimizer thing that may or may not occur depending on the circumstances.
They're evaluated at the parsing time, thus staying the same until the query is kept prepared. > When I changed from shorthand to full casts, the behaviour was as documented, > i.e. time and day progressed. Full casts are evaluated at runtime. > I also noticed that, in the case of shorthand casts, the cached date/time > values are taken at prepare time, not at the time the first shorthand cast is > encountered or even the start time of the first execution. True. > With CURRENT_TIMESTAMP and friends, it's another thing: they are (as > documented) evaluated once per module execution (don't know yet if at start > or at first encounter), not at prepare time. They're evaluated at the request start. 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