Details
-
Technical task
-
Status: Open (View Workflow)
-
Major
-
Resolution: Unresolved
-
None
-
None
-
None
-
None
Description
Lets implement anchored data types inside a ROW():
- references to table columns
- references to SP variables
Example with sql_mode=DEFAULT:
CREATE OR REPLACE TABLE t1 (a INT, b VARCHAR(10)); |
DELIMITER $$
|
CREATE OR REPLACE PROCEDURE p1() |
BEGIN
|
DECLARE x ROW(a TYPE OF t.a, b TYPE OF t1.b) DEFAULT ROW(1,'a'); |
SELECT x.a, x.b; |
END; |
$$
|
DELIMITER ;
|
CALL p1;
|
Example with sql_mode=ORACLE:
SET sql_mode=ORACLE; |
CREATE OR REPLACE TABLE t1 (a INT, b VARCHAR(10)); |
DELIMITER $$
|
CREATE OR REPLACE PROCEDURE p1 AS |
x ROW(a TYPE OF t.a, b TYPE OF t1.b) DEFAULT ROW(1,'a'); |
BEGIN
|
SELECT x.a, x.b; |
END; |
$$
|
DELIMITER ;
|
CALL p1;
|
Attachments
Issue Links
- relates to
-
MDEV-34317 DECLARE TYPE type_name IS RECORD (..) with scalar members in stored routines
- In Testing