我想通过将输入变量和输出传递为 oracle 中的 json 格式来创建存储过程?

I want to create a stored procedure by passing input variable and output to be in json format in oracle?

我们需要在 Oracle 中创建一个存储过程,以 JSON 格式传递输入变量和输出。我试过使用 listagg() 但在执行该过程时出现 "result of string concatenation is too long" 错误。

程序的预期输出必须采用 JSON 格式。

PL/SQL 中的常规 select 默认使用绑定变量,您可能想看看 https://github.com/doberkofler/PLSQL-JSON 以生成 json。

使用了 xmlagg 并且有效 select (SELECT RTRIM(xmlcast(XMLAGG( XMLELEMENT(E, columnname|| ',') ) AS clob) ,',') FROM table) ||'}' 来自 dual