SQL routines# A SQL routine is a custom, user-defined function authored by a user of Trino in a client and written in SQL. More details are available in the following sections: Introduction Examples BEGIN CASE DECLARE FUNCTION IF ITERATE LEAVE LOOP REPEAT RETURN SET WHILE