need 2 UDFs for Firebird 1.5 : 1. random_(avalue integer) will return a random integer btw 0 and avalue-1 . Be sure that everytime is called, the returned number is different as often as expected. This UDF should replace the current random UDF that seems to be cached and will usually return the same number when called inside a stored procedure. In other words: calling i=1; while (i<=100) do begin result=random_(100); suspend; i=i+1; end should return 100 mostly different numbers. 2. time_ it should return the current time in the following formats - result char(23) (es: 2008-10-10 23:58:02.312) I am aware that function declare external function getExactTimestamp timestamp returns parameter 1 entry_point 'getExactTimestamp' module_name 'fbudf'; exists . However this function gives me several weird problems, so I'd like to dump it. I need UDFs for _both Windows and for Linux_. Source code should be in Pascal.