Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion docs/src/main/sphinx/routines.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
# 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:
a client and written in the SQL routine language. Routines are scalar functions
that return a single output value. More details are available in the following
sections:

```{toctree}
:maxdepth: 1
Expand Down
11 changes: 8 additions & 3 deletions docs/src/main/sphinx/routines/introduction.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
# Introduction to SQL routines

A SQL routine is a custom, user-defined function authored by a user of Trino and
written in the SQL routine language. You can declare the routine body within a
[](/routines/function) block as [inline routines](routine-inline) or [catalog
routines](routine-catalog).
written in the SQL routine language. Routines are scalar functions that return a
single output value, similar to [built-in functions](/functions).

[Declare the routine](routine-declaration) with a `FUNCTION` definition using
the supported SQL routine statements. A routine can be declared and used as an
[inline routine](routine-inline) or declared as a [catalog
routine](routine-catalog) and used repeatedly.

(routine-inline)=
## Inline routines
Expand Down Expand Up @@ -88,6 +92,7 @@ Use the [](/connector/memory) in a catalog for simple storing and
testing of your SQL routines.
:::

(routine-declaration)=
## Routine declaration

Refer to the documentation for the [](/routines/function) keyword for more
Expand Down