SQL Manage Procedures
The Procedures & Functions activity lists every stored routine in the current database — both procedures and user-defined functions — with mode-aware parameter tables, DDL viewers, and one-click drop/edit. It is the fastest way to audit or evolve a codebase-worth of server-side logic.
CREATE PROCEDURE or CREATE FUNCTION template in the SQL Editor.Each row shows an icon that distinguishes routines by kind:
CALL or EXEC.SELECT.Hover actions:
| Action | Effect |
|---|---|
| Edit | Loads the routine's DDL into the SQL Editor for modification. |
| Show DDL | Opens the DDL viewer with the full CREATE PROCEDURE / CREATE FUNCTION. |
| Drop | Confirms, then issues DROP PROCEDURE / DROP FUNCTION. |
Expanding a routine lazily fetches its parameter metadata and renders it as a compact table:
| Mode | Name | Type | Default |
|---|---|---|---|
| IN | p_tenant_id | INTEGER | — |
| OUT | p_total | NUMERIC(12,2) | — |
| INOUT | p_batch_id | UUID | gen_random_uuid() |
Mode chips are color-coded: green for IN, amber for OUT, blue for INOUT. Routines with no parameters show a clear empty state.
Click New to open a template in the SQL Editor. A typical procedure:
CREATE OR REPLACE PROCEDURE archive_stale_orders(p_before TIMESTAMP)
LANGUAGE plpgsql
AS $$
BEGIN
INSERT INTO orders_archive
SELECT * FROM orders WHERE created_at < p_before;
DELETE FROM orders WHERE created_at < p_before;
END;
$$;
A scalar function:
CREATE FUNCTION full_name(p_first VARCHAR, p_last VARCHAR)
RETURNS VARCHAR
LANGUAGE SQL
IMMUTABLE
AS $$
SELECT p_first || ' ' || p_last;
$$;
PROCEDURE (no return value, called with CALL) from FUNCTION. Both may declare LANGUAGE plpgsql, sql, plpython3u, etc.DELIMITER around routine bodies; the SQL Editor sets this automatically.CREATE OR ALTER PROCEDURE; parameters use the @name prefix.Download and start managing your MongoDB databases with ease.
Download Free Trial