FirebirdSQL logo

Stored Functions

A stored function is executable code stored in the database metadata for execution on the server.It can be called by other stored functions (including itself), procedures, triggers, and client applications through DML statements.A function that calls itself is known as recursive.

Unlike stored procedures, stored functions always return one scalar value.To return a value from a stored function, use the RETURN statement, which immediately terminates the function.

Creating a Stored Function

For information about creating stored functions, see CREATE FUNCTION in [fblangref50-ddl].