Firebird Documentation Index → Firebird 3.0.6 Release Notes → Procedural SQL (PSQL) → PSQL Stored Functions |
![]() |
![]() |
![]() ![]() ![]() ![]() |
It is now possible to write a scalar function in PSQL and call it just like an internal function.
Syntax for the DDL
{CREATE [OR ALTER] | ALTER | RECREATE} FUNCTION <name> [(param1 [, ...])] RETURNS <type> AS BEGIN ... END
The CREATE statement is the declaration syntax for PSQL functions, parallel to DECLARE for legacy UDFs.
Example
CREATE FUNCTION F(X INT) RETURNS INT AS BEGIN RETURN X+1; END; SELECT F(5) FROM RDB$DATABASE;
![]() ![]() ![]() ![]() |
Firebird Documentation Index → Firebird 3.0.6 Release Notes → Procedural SQL (PSQL) → PSQL Stored Functions |