Skip to content

Commit 6f042a7

Browse files
committed
Revert "added"
This reverts commit 5cb6f55.
1 parent 33e932e commit 6f042a7

File tree

2 files changed

+2
-50
lines changed

2 files changed

+2
-50
lines changed

docs/en/guides/54-query/08-stored-procedure.md

Lines changed: 1 addition & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ A stored procedure is a set of executable commands or logic blocks stored within
66

77
## Supported Languages
88

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.
1010

1111
### SQL Scripting
1212

@@ -84,57 +84,9 @@ In Databend, stored procedures support a rich set of features to allow users to
8484
- **Single-line comments**: `-- comment`
8585
- **Multi-line comments**: `/* comment */`
8686

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-
9987
## Managing Stored Procedures
10088

10189
Databend offers a range of commands for managing stored procedures. For more details, see [Stored Procedure](/sql/sql-commands/ddl/procedure/).
10290

10391
## Usage Example
10492

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.
106-
107-
```sql
108-
SET enable_experimental_procedure = 1;
109-
110-
CREATE PROCEDURE sum_even_numbers(start_val UInt8, end_val UInt8)
111-
RETURNS UInt8 NOT NULL
112-
LANGUAGE SQL
113-
COMMENT='Calculate the sum of all even numbers'
114-
AS $$
115-
BEGIN
116-
LET sum := 0;
117-
FOR i IN start_val TO end_val DO
118-
IF i % 2 = 0 THEN
119-
sum := sum + i;
120-
END IF;
121-
END FOR;
122-
123-
RETURN sum;
124-
END;
125-
$$;
126-
```
127-
128-
If we want to calculate the sum of all even numbers from 1 to 10, we can call the procedure as follows:
129-
130-
```sql
131-
CALL PROCEDURE sum_even_numbers(1, 10);
132-
133-
-- Result: 2 + 4 + 6 + 8 + 10 = 30
134-
┌────────┐
135-
│ Result │
136-
├────────┤
137-
│ 30 │
138-
└────────┘
139-
```
140-

docs/en/sql-reference/10-sql-commands/00-ddl/18-procedure/create-procedure.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ $$;
2727
| `<procedure_name>` | Name of the procedure. |
2828
| `<parameter_name> <data_type>` | Input parameters (optional), each with a specified data type. Multiple parameters can be defined and separated by commas. |
2929
| `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. |
3131
| `COMMENT` | Optional text describing the procedure. |
3232
| `AS ...` | Encloses the procedure body, which contains SQL statements, variable declarations, loops, and a RETURN statement. |
3333

0 commit comments

Comments
 (0)