Skip to Main Content

APEX

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!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Row to Json

User_H0ZXVJan 26 2022

Hello!
Need some help with APEX_JSON package.
Basic task: need a function to convert any input row to json. Sample of code:

DECLARE
  l_rent_id number;
  l_game_box_cursor SYS_REFCURSOR;
  l_buffer varchar2(4096);
BEGIN
  APEX_JSON.initialize_clob_output();

  OPEN l_game_box_cursor FOR
    SELECT * FROM game_box WHERE id = 1;

  APEX_JSON.open_object();
  APEX_JSON.write('game_box', l_game_box_cursor);  
  APEX_JSON.close_object();

  CLOSE l_game_box_cursor;

 -- l_buffer := APEX_JSON.get_clob_output();
END;

But all the time got en error:

ORA-12705: Cannot access NLS data files or invalid environment specified
ORA-06512: at "APEX_210200.WWV_FLOW_JSON", line 3602
ORA-06512: at "APEX_210200.WWV_FLOW_JSON", line 3841
ORA-06502: PL/SQL: numeric or value error: character string buffer too small
ORA-06512: at "SYS.DBMS_SQL", line 1750
ORA-06512: at "APEX_210200.WWV_FLOW_JSON", line 3801
ORA-06512: at "APEX_210200.WWV_FLOW_JSON", line 4212
ORA-06512: at line 10
ORA-06512: at "SYS.DBMS_SQL", line 1721

What I'm doing wrong?

Comments

Post Details

Added on Jan 26 2022
1 comment
621 views