From c810d2a4d2566cea306e1be6ba0427af98728cbe Mon Sep 17 00:00:00 2001 From: Manfred Moser Date: Mon, 29 Jul 2024 08:35:31 -0700 Subject: [PATCH] Improve SQL routine description - And overview with links to more details --- docs/src/main/sphinx/routines.md | 4 +++- docs/src/main/sphinx/routines/introduction.md | 11 ++++++++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/docs/src/main/sphinx/routines.md b/docs/src/main/sphinx/routines.md index 42e5b202a794..541608d529d2 100644 --- a/docs/src/main/sphinx/routines.md +++ b/docs/src/main/sphinx/routines.md @@ -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 diff --git a/docs/src/main/sphinx/routines/introduction.md b/docs/src/main/sphinx/routines/introduction.md index f444c29374a2..b6fb55d05631 100644 --- a/docs/src/main/sphinx/routines/introduction.md +++ b/docs/src/main/sphinx/routines/introduction.md @@ -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 @@ -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