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 SELECT INTO targets:
cursor%ROWTYPE field as SELECT 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
|
SELECT 10,'b1' INTO rec.a, rec.b; |
SELECT rec.a, rec.b; |
END; |
$$
|
DELIMITER ;
|
CALL p1;
|
table%ROWTYPE fields as SELECT INTO target:
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
|
SELECT 10,'b1' INTO rec.a, rec.b; |
SELECT rec.a, rec.b; |
END; |
$$
|
DELIMITER ;
|
CALL p1;
|
Attachments
Issue Links
- relates to
-
MDEV-12291 Allow ROW variables as SELECT INTO targets
- Closed
-
MDEV-12333 Allow %ROWTYPE variable fields as FETCH INTO targets
- Open