数据仓库服务 GAUSSDB(DWS)-JSON/JSONB函数:json_populate_recordset(anyelement, array-json [, bool])

时间:2024-04-18 16:25:05

json_populate_recordset(anyelement, array-json [, bool])

描述:参考函数json_populate_record、jsonb_populate_record,对$2数组的每一个元素进行上述参数函数的操作,因此这也要求$2数组的每个元素都是object-json类型。

返回类型:setof anyelement

示例:

1
2
3
4
5
6
7
CREATE TYPE jpop AS (a text, b INT, c timestamp);
SELECT * FROM json_populate_recordset(null::jpop, '[{"a":1,"b":2},{"a":3,"b":4}]');
 a | b | c
---+---+---
 1 | 2 |
 3 | 4 |
(2 rows)
support.huaweicloud.com/sqlreference-830-dws/dws_06_0356.html
推荐文章