Details
-
Technical task
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
None
-
10.2.2-3, 10.2.2-1, 10.2.2-2, 10.2.2-4, 10.1.18
Description
In addition to FOR loops on explicitly declared cursors (MDEV-10581), we'll implement FOR loops for implicit cursors.
The SQL query for the implicit cursor is declared directly inside the FOR loop:
DROP TABLE IF EXISTS t1; |
CREATE TABLE t1 (a INT, b INT); |
INSERT INTO t1 VALUES (10,20); |
 |
DROP PROCEDURE IF EXISTS p1; |
DELIMITER /
|
CREATE PROCEDURE p1 AS |
BEGIN
|
FOR rec IN (SELECT a, b FROM t1) |
LOOP
|
SELECT rec.a, rec.b; |
END LOOP; |
END; |
/
|
DELIMITER ;
|
CALL p1();
|
Attachments
Issue Links
- blocks
-
MDEV-12314 sql_mode=ORACLE: Implicit cursor FOR LOOP for cursors with parameters
- Closed
- causes
-
MDEV-32275 getting error 'Illegal parameter data types row and bigint for operation '+' ' when using ITERATE in a FOR..DO
- Closed
- is blocked by
-
MDEV-10581 sql_mode=ORACLE: Explicit cursor FOR LOOP
- Closed
- relates to
-
MDEV-16674 Document FOR loop
- Open
-
MDEV-17278 CURSOR FOR LOOP - ERROR: unexpected end of stream, read 0 bytes (SERVER CRASH)
- Closed