Subject | Re: [firebird-support] Re: Making evaluation of UDFs constant across a query |
---|---|
Author | Mike Pomraning |
Post date | 2011-03-20T17:46:43Z |
On Sat, Mar 19, 2011 at 12:47 PM, homerjones1941 <homer@...>wrote:
environments, when you already know all the queries you want to run.
However, I find it too restrictive for general or "on the fly" querying.
Another possibility is using a table or GTT or RDB$SET_CONTEXT() to store
the precomputed value. In this case you'd have to explicitly compute the
value before every SELECT, which is still cumbersome but more flexible IMHO
than using a stored procedure.
But, I'm wondering if there is an easier technique than any of the above.
-Mike
[Non-text portions of this message have been removed]
>In a stored procedure, yes. IMHO this is suitable for regular, production
> > Is there a technique to make the return value of a UDF constant across
> > the execution of a single query?
> >
> > For example, I'd like getExactTimestamp() -- or, rather, a UDF very
> > much like it -- to return the same result every time it is evaluated...
>
> Can you declare a variable, and then just assign the value once?
>
environments, when you already know all the queries you want to run.
However, I find it too restrictive for general or "on the fly" querying.
Another possibility is using a table or GTT or RDB$SET_CONTEXT() to store
the precomputed value. In this case you'd have to explicitly compute the
value before every SELECT, which is still cumbersome but more flexible IMHO
than using a stored procedure.
But, I'm wondering if there is an easier technique than any of the above.
-Mike
[Non-text portions of this message have been removed]