Preserve capitalization of column names/keys returned by SYS_REFCURSOR in Oracle I am using a SYS_REFCURSOR to return JSON data to an ORDS endpoint. I need the case of the returned column names/JSON keys to be preserved for use in my node application. I have tried the following:
OPEN l_cursor for SELECT p.productid as &quot;ProductID&quot; from productnew p;

open l_cursor for SELECT p.productid &quot;ProductID&quot; from productnew p;

open l_cursor for SELECT p.ProductID as &quot;ProductID&quot; from productnew p;

open l_cursor for SELECT p.ProductID &quot;ProductID&quot; from productnew p;

These all return as productid instead of ProductID. When I change it to  as &quot;ProductIDs&quot;(note the s), I get productids, so it is just the capitalization of the key/columnname that is the issue.
Is this possible to change?
Too long for a comment.
When I did a
declare
cursor_number number;
description_table dbms_sql.desc_tab;
l_cursor SYS_REFCURSOR;
column_count number;
begin
OPEN l_cursor for SELECT dummy as &quot;Dummy&quot; from dual;
cursor_number:=dbms_sql.TO_CURSOR_NUMBER(l_cursor);
dbms_sql.describe_columns(cursor_number,column_count,description_table);
for k in 1..column_count loop
    dbms_output.put_line(description_table(k).col_name);
    end loop;
end;
/

the ouput is
Dummy

as expected. So SYS_REFCURSOR behaves correctly.
Also
create table productnew (productid  number)
/
declare
cursor_number number;
description_table dbms_sql.desc_tab;
l_cursor SYS_REFCURSOR;
column_count number;
begin
OPEN l_cursor for SELECT p.productid as &quot;ProductID&quot; from productnew p;
cursor_number:=dbms_sql.TO_CURSOR_NUMBER(l_cursor);
dbms_sql.describe_columns(cursor_number,column_count,description_table);
for k in 1..column_count loop
    dbms_output.put_line(description_table(k).col_name);
    end loop;
end;
/

returns
ProductID

So the problem isn't at the database.