Details
-
Technical task
-
Status: Open (View Workflow)
-
Major
-
Resolution: Unresolved
-
10.3(EOL)
-
None
Description
Under term of this task we'll allow to specify fields of cursor%ROWTYPE and table%ROWTYPE variables as FETCH INTO targets:
cursor%ROWTYPE fields as FETCH INTO targets:
SET sql_mode=ORACLE; |
DROP PROCEDURE IF EXISTS p1; |
DELIMITER $$
|
CREATE PROCEDURE p1 AS |
CURSOR cur IS SELECT 10 as a, 'b1' AS b; |
rec cur%ROWTYPE;
|
BEGIN
|
OPEN cur; |
FETCH cur INTO rec.a, rec.b; |
CLOSE cur; |
SELECT rec.a, rec.b; |
END; |
$$
|
DELIMITER ;
|
CALL p1;
|
table%ROWTYPE field as FETCH INTO targets:
SET sql_mode=ORACLE; |
DROP TABLE IF EXISTS t1; |
DROP PROCEDURE IF EXISTS p1; |
CREATE TABLE t1 (a INT, b VARCHAR(10)); |
INSERT INTO t1 VALUES (10,'b1'); |
DELIMITER $$
|
CREATE PROCEDURE p1 AS |
CURSOR cur IS SELECT * FROM t1; |
rec t1%ROWTYPE;
|
BEGIN
|
OPEN cur; |
FETCH cur INTO rec.a, rec.b; |
CLOSE cur; |
SELECT rec.a, rec.b; |
END; |
$$
|
DELIMITER ;
|
CALL p1;
|
Attachments
Issue Links
- relates to
-
MDEV-12334 Allow %ROWTYPE variable fields as SELECT INTO targets
- Open
-
MDEV-12291 Allow ROW variables as SELECT INTO targets
- Closed