ROW TYPE OF
This page is part of MariaDB's Documentation.
The parent of this page is: Data Types for MariaDB Enterprise Server
Topics on this page:
Overview
EXAMPLES
CREATE TABLE rowtypeof_table(
descr VARCHAR(20),
val INT
);
INSERT INTO rowtypeof_table VALUES ('Life', 42);
DELIMITER $$
CREATE PROCEDURE rowtypeof_proc()
BEGIN
DECLARE rec1 ROW TYPE OF rowtypeof_table;
SELECT * INTO rec1 FROM rowtypeof_table;
SELECT rec1.descr, rec1.val;
END;
$$
DELIMITER ;
CALL rowtypeof_proc();
+------------+----------+
| rec1.descr | rec1.val |
+------------+----------+
| Life | 42 |
+------------+----------+