You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add Sleep function as common fbudf function.
This is helpful during obtaining lock or testing.
Declaration like:
DECLARE EXTERNAL FUNCTION Sleep
INTEGER NULL
RETURNS INTEGER BY VALUE
ENTRY_POINT 'Sleep' MODULE_NAME 'masaudf';
Implementation (in pascal):
function Sleep(time:PINT):integer; cdecl;
begin
result:=0;
if time=nil then exit;
windows.Sleep(time^);
end;
The text was updated successfully, but these errors were encountered:
UDF suppport will sooner of all be deprecated in FB4 (in favor of UDR).
I.e. in the exact form this suggestion is hardly realistic. But what about adding UDR sleep() for various debugging purposes - why not.
Almost every test that is created to emulate work of real users need for pause mechanism between SQL statements. Currently it can be implemented either using shell calls (ping or sleep) or by artificial delay using 'set transaction lock timeout N' + try to lock the record which was already locked. This is ugly way, of course, but it is the only way to do pause inside PSQL (inside execute block etc).
Please consider adding such feature into FB-3 - as built-in func like rdb$get/set_context(). FB-3 will be 'mainstream' after 1-2 year and for 4-5 years for sure.
Submitted by: Slavomir Skopalik (skopaliks)
Votes: 4
Add Sleep function as common fbudf function.
This is helpful during obtaining lock or testing.
Declaration like:
DECLARE EXTERNAL FUNCTION Sleep
INTEGER NULL
RETURNS INTEGER BY VALUE
ENTRY_POINT 'Sleep' MODULE_NAME 'masaudf';
Implementation (in pascal):
function Sleep(time:PINT):integer; cdecl;
begin
result:=0;
if time=nil then exit;
windows.Sleep(time^);
end;
The text was updated successfully, but these errors were encountered: