Important
The SingleStore 9.1 release candidate (RC) is available now. It will be promoted to general availability (GA) soon and at that time it will be renamed to SingleStore 10.
In the interim, SingleStore 9.1 RC can be used to preview, evaluate, and provide feedback on the new and upcoming features in SingleStore 10, while SingleStore 9.0 is recommended for production workloads.
ROW
On this page
The ROW() function constructs a RECORD object that may be used in an expression or assigned into a RECORD type variable.
Example
The following function creates a record value using ROW():
DELIMITER //CREATE FUNCTION f() RETURNS INT ASDECLAREr RECORD(a int, b int);BEGINr = ROW(1, 2);RETURN r.a + r.b;END //DELIMITER ;
Here’s an example use of this function:
SELECT f();
+------+
| f() |
+------+
| 3 |
+------+Type Inference The data types of the fields of the new RECORD object created are inferred from the context of the function or stored procedure.ROW() into a record variable, the types of the fields of the new record will be the same as the types of the fields of the record variable to which the new record value is assigned.int based on the assignment to the variable r.
Related Topics
-
RECORD: The
RECORDdata type is an encapsulated group of named fields. -
CREATE_
ARRAY: CREATE_is used to create an array object.ARRAY()
Last modified: