I have a situation, where I need to pass local table column values to the server table via RESTful services. My local table has 7 columns including 3 NCLOB data-type which may contain data characters more than 32k. I am using apex_web_service.make_rest_request for my RESTful services. At the run-time my code fails to make a request to the service on a line of code where I append the nclob data column value (data > 32k) to l_post variable for p_body parameter:
apex_web_service.make_rest_request( p_url => l_url, p_http_method => 'POST', p_body => l_post);
The above utility function apex_web_service.make_rest_request() works good when variable l_post for parameter p_body has data less than 32k, and fails when it exceeds 32k. The CLOB datatype as I understand has 4gb of limit, so I don't see a point of 'length issue' for its real cause.The error message I get at the debug window is:
...Error data: ......message: AJAX call returned server error ORA-06502: PL/SQL: numeric or value error: raw variable length too long for Execute PL/SQL Code. ......is_internal_error: true ......apex_error_code: APEX.AJAX_SERVER_ERROR ......ora_sqlcode: -6502 ......ora_sqlerrm: ORA-06502: PL/SQL: numeric or value error: raw variable length too long
Also on the other hand, passing an nclob variable 'l_post' to apex_web_service.make_rest_request() instead of clob data-type, as I can see would not cause an issue 'of data-type mismatch' because in a scenario where my data for l_post has length lesser than 32k, the rest runs successfully.
I saw another post with same problem raised here at the OTN forums: apex_web_service.make_rest_request getting ORA-06502 But the post is archived, could not find anyone responding to this post?
Is this a bug with APEX because error 'raw variable length too long' seems to be associated with varchar2 assigned with data exceeding 32k?
My current apex running environment details are:
Oracle 11g r2
Application Express 4.2.3.00.08
WebLogic Server Version: 10.3.4.0
Does anyone has a way out to pass p_body (>32k) via REST?