Skip to Main Content

ORDS, SODA & JSON in the Database

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

ORDER BY is not workable when use JSON_ARRAYAGG( ) to return JSON dataset

Old XuDec 5 2024 — edited Dec 5 2024

for example:

declare
v_result clob;
begin
EXECUTE IMMEDIATE 'SELECT JSON_ARRAYAGG(JSON_OBJECT(*)) FROM (select empno, ename, sal from emp order by sal)' into v_result;
DBMS_OUTPUT.PUT_LINE(v_result);
end;

The returned json dataset in v_result is not in order by sal.

Comments
Post Details
Added on Dec 5 2024
1 comment
365 views