Procedural SQL Reference
Warning
SingleStore 9.0 gives you the opportunity to preview, evaluate, and provide feedback on new and upcoming features prior to their general availability. In the interim, SingleStore 8.9 is recommended for production workloads, which can later be upgraded to SingleStore 9.0.
This section contains information about SingleStore Procedural SQL (PSQL), which encompasses stored procedures, user-defined scalar-value functions (UDFs), user-defined table-valued functions (TVFs), and user-defined aggregate functions (UDAFs).
SingleStore also supports Wasm-based functions.
Extensions in SingleStore allow you to combine user-defined objects, such as UDFs or UDAFs, into a packaged archive and then create, manage, and deploy these objects and other resources using the CREATE EXTENSION
command.
For information on when to use PSQL, Wasm-based, or external functions, refer to Choose Between PSQL, Wasm-based, and External Functions.
In this section
- Anonymous Code Blocks
- Control Flow Statements
- Exceptions and Exception Handling
- MySQL Client Delimiters
- Transactions in Stored Procedures
- Extensions
- CREATE AGGREGATE
- CREATE EXTERNAL FUNCTION
- CREATE FUNCTION (UDF)
- CREATE FUNCTION (TVF)
- CREATE PROCEDURE
- CREATE TEMPORARY PROCEDURE
- DROP FUNCTION
- DROP PROCEDURE
- DROP AGGREGATE
- SHOW AGGREGATES
- SHOW CREATE AGGREGATE
- SHOW CREATE FUNCTION
- SHOW CREATE PROCEDURE
- SHOW FUNCTIONS
- SHOW PROCEDURES
- %ROWTYPE and %TYPE
- ARRAY
- CALL
- CREATE_ARRAY
- COLLECT
- ECHO
- ECHO SELECT
- EXECUTE IMMEDIATE
- INSERT_ALL
- RECORD
- ROW
- QUERY
- SCALAR
- TO_QUERY
Last modified: May 15, 2025