Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve SQL routine docs #19880

Merged
merged 1 commit into from
Nov 29, 2023
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
2 changes: 1 addition & 1 deletion docs/src/main/sphinx/routines/function.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
```text
FUNCTION name ( [ parameter_name data_type [, ...] ] )
RETURNS type
[ LANGUAGE langauge]
[ LANGUAGE language]
[ NOT? DETERMINISTIC ]
[ RETURNS NULL ON NULL INPUT ]
[ CALLED ON NULL INPUT ]
Expand Down
17 changes: 11 additions & 6 deletions docs/src/main/sphinx/routines/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,11 +125,11 @@ before the following keywords:
* `REPEAT`
* `WHILE`

The label is used to name the block in order to continue processing with the
`ITERATE` statement or exit the block with the `LEAVE` statement. This flow
control is supported for nested blocks, allowing to continue or exit an outer
block, not just the innermost block. For example, the following snippet uses the
label `top` to name the complete block from `REPEAT` to `END REPEAT`:
The label is used to name the block to continue processing with the `ITERATE`
statement or exit the block with the `LEAVE` statement. This flow control is
supported for nested blocks, allowing to continue or exit an outer block, not
just the innermost block. For example, the following snippet uses the label
`top` to name the complete block from `REPEAT` to `END REPEAT`:

```sql
top: REPEAT
Expand Down Expand Up @@ -171,7 +171,12 @@ when writing and running SQL routines:

The following limitations apply to SQL routines.

* Routines must be declared before than can be referenced.
* Routines must be declared before they are referenced.
* Recursion cannot be declared or processed.
* Mutual recursion can not be declared or processed.
* Queries cannot be processed in a routine.

Specifically this means that routines can not use `SELECT` queries to retrieve
data or any other queries to process data within the routine. Instead queries
can use routines to process data. Routines only work on data provided as input
values and only provide output data from the `RETURN` statement.
Loading