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 typeof_table(
descr VARCHAR(20),
val INT
);
INSERT INTO typeof_table VALUES ('Life', 42);
DELIMITER $$
CREATE PROCEDURE typeof_proc()
BEGIN
DECLARE descr TYPE OF typeof_table.descr;
DECLARE val TYPE OF typeof_table.val;
SELECT * INTO descr, val FROM typeof_table;
SELECT descr, val;
END;
$$
DELIMITER ;
CALL typeof_proc();
+-------+------+
| descr | val |
+-------+------+
| Life | 42 |
+-------+------+