Skip to content

object_construct

Returns an OBJECT constructed from the arguments.

object_construct( [<key>, <value> [, <key>, <value> , ...]] )

The key in a key-value pair. Each key is a string value.

The value that is associated with the key. The value can be any data type.

Returns a value of type OBJECT.

This example shows how to construct a simple object:

SELECT object_construct('a', 1, 'b', 'BBBB', 'c', NULL);
+--------------------------------------------------+
| object_construct('a', 1, 'b', 'BBBB', 'c', NULL) |
+--------------------------------------------------+
| {"a":1,"b":'BBBB'} |
+--------------------------------------------------+
ScopeDB Logo ScopeDB
© 2025 ScopeDB. All rights reserved.