FirebirdSQL logo

Procedural SQL (PSQL) is a procedural extension of SQL.This language subset is used for writing PSQL modules: stored procedures, stored functions, triggers, and PSQL blocks.

PSQL provides all the basic constructs of traditional structured programming languages, and also includes DML statements (SELECT, INSERT, UPDATE, DELETE, etc.), with a slightly modified syntax in some cases.

Elements of PSQL

A PSQL module may contain declarations of local variables, subroutines and cursors, assignments, conditional statements, loops, statements for raising custom exceptions, error handling and sending messages (events) to client applications.DML triggers have access to special context variables, two “records” that store, respectively, the NEW values for all columns during insert and update activity, and the OLD values during update and delete work, and three Boolean variables — INSERTING, UPDATING and DELETING — to determine the event that fired the trigger.

Statements that modify metadata (DDL) are not available in PSQL.