Search code examples
sqlstored-proceduresfirebirdsleepfirebird2.5

Pause a procedure execution


Programming languages like javascript and c# have ways to pause the current thread execution, with sleep(), pause(), etc.

How can I pause a Firebird procedure while it is running?


Solution

  • Other than using SUSPEND as suggested by user13964273, there is no way to pause execution or 'sleep' in Firebird PSQL itself. Using SUSPEND for sleep will only work with close cooperation with the application doing the fetching, so it is not actually a proper solution.

    Firebird PSQL is not a general-purpose language. Wanting to pause within a stored procedure does not make much sense to me. Also, in SuperServer mode, actually sleeping (e.g. using UDF) within a stored procedure could - as far as I understand the inner-workings of Firebird - prevent other connections to the same database from doing work.