You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/en/guides/54-query/08-stored-procedure.md
+1-49Lines changed: 1 addition & 49 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@ A stored procedure is a set of executable commands or logic blocks stored within
6
6
7
7
## Supported Languages
8
8
9
-
**Databend currently supports [SQL Scripting](#sql-scripting) only**. Using SQL scripting, users can define procedures with control flow constructs like loops (FOR, WHILE, REPEAT) and conditionals (IF, CASE), enabling complex logic and effective multi-step operations.
9
+
**Databend currently supports [SQL scripting](#sql-scripting) only**. Using SQL scripting, users can define procedures with control flow constructs like loops (FOR, WHILE, REPEAT) and conditionals (IF, CASE), enabling complex logic and effective multi-step operations.
10
10
11
11
### SQL Scripting
12
12
@@ -84,57 +84,9 @@ In Databend, stored procedures support a rich set of features to allow users to
84
84
-**Single-line comments**: `-- comment`
85
85
-**Multi-line comments**: `/* comment */`
86
86
87
-
## Limitations
88
-
89
-
The following limitations apply when working with stored procedures:
90
-
91
-
- Stored procedures are an experimental feature. Before working with them, set`enable_experimental_procedure` to 1;
92
-
93
-
```sql
94
-
SET enable_experimental_procedure = 1;
95
-
```
96
-
97
-
- Stored procedures return results as strings, regardless of the specified return type, without enforcing the declared type on the returned value.
98
-
99
87
## Managing Stored Procedures
100
88
101
89
Databend offers a range of commands for managing stored procedures. For more details, see [Stored Procedure](/sql/sql-commands/ddl/procedure/).
102
90
103
91
## Usage Example
104
92
105
-
Suppose we want to calculate the sum of all even numbers within a given range. This stored procedure accepts a starting value start_val and an ending value end_val and calculates the sum of all even numbers within this range.
Copy file name to clipboardExpand all lines: docs/en/sql-reference/10-sql-commands/00-ddl/18-procedure/create-procedure.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -27,7 +27,7 @@ $$;
27
27
|`<procedure_name>`| Name of the procedure. |
28
28
|`<parameter_name> <data_type>`| Input parameters (optional), each with a specified data type. Multiple parameters can be defined and separated by commas. |
29
29
|`RETURNS <return_data_type> [NOT NULL]`| Specifies the data type of the return value. `NOT NULL` ensures the returned value cannot be NULL. |
30
-
|`LANGUAGE`| Specifies the language in which the procedure body is written. Currently, only `SQL` is supported. For details, see [SQL Scripting](/guides/query/stored-procedure#sql-scripting).|
30
+
|`LANGUAGE`| Specifies the language in which the procedure body is written. Currently, only `SQL` is supported. |
31
31
|`COMMENT`| Optional text describing the procedure. |
32
32
|`AS ...`| Encloses the procedure body, which contains SQL statements, variable declarations, loops, and a RETURN statement. |
0 commit comments