添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
相关文章推荐
失望的鸵鸟  ·  Is there any oracle ...·  14 小时前    · 
鼻子大的毛衣  ·  How to post array in ...·  15 小时前    · 
精明的日记本  ·  Invalid update: ...·  昨天    · 
八块腹肌的春卷  ·  Common MySQL ...·  2 天前    · 
好帅的小刀  ·  curl: (56) Failure ...·  3 月前    · 
睿智的伤疤  ·  ‘await’ ...·  10 月前    · 
急躁的饭卡  ·  点击label时click事件 ...·  1 年前    · 

JSON_agg_returning_clause

Use this clause to specify the data type of the character string returned by this function. You can specify the following data types:

VARCHAR2[( size [BYTE,CHAR])]

When specifying the VARCHAR2 data type elsewhere in SQL, you are required to specify a size. However, in this clause you can omit the size.

If you omit this clause, or if you specify VARCHAR2 but omit the size value, then JSON_ARRAYAGG returns a character string of type VARCHAR2(4000) .

Refer to " Data Types " for more information on the preceding data types.

STRICT

Specify the STRICT clause to verify that the output of the JSON generation function is correct JSON. If the check fails, a syntax error is raised.

Refer to JSON_OBJECT for examples.

Examples

The following statements creates a table id_table , which contains ID numbers:

CREATE TABLE id_table (id NUMBER);
INSERT INTO id_table VALUES(624);
INSERT INTO id_table VALUES(null);
INSERT INTO id_table VALUES(925);
INSERT INTO id_table VALUES(585);

The following example constructs a JSON array from the ID numbers in table id_table :

SELECT JSON_ARRAYAGG(id ORDER BY id RETURNING VARCHAR2(100)) ID_NUMBERS
  FROM id_table;
ID_NUMBERS
-------------
[585,624,925]