Subject Re: Does FB 1.5 support RAND function?
Author Adam
--- In, <myles@...> wrote:
> According to the documentation in 'The Firebird Book' (brilliant
book, by
> the way), the RAND function is not supported in Firebird 1.5. Is
there an
> alternative to this function that I can use?

What does this function do?

Return a random record from the table? If so I imagine you could read
the current generator value and use a UDF function to get a random ID
in that range for the table. It is possible it may return a 'not yet
committed' or 'since been deleted' value, so you will need to put some
sort of retry logic, and an abort (ie choose the first record) if a
significant number or retries fail. This could all be done within a
stored procedure.

Of do you mean return a random number between 0 and 1? If so, I am
sure you will find a UDF to help you out.

Again, a simple example of the sort of thing you are trying to do will
make it easier to suggest a good way of doing it.