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!

Page item display > 32767 characters (via computation)

646237Apr 8 2011 — edited Apr 8 2011
Hello everyone,

Running APEX 3.2.1.00.11

I am trying to generate values for a page item using a PL/SQL function body. It parses and concatenates many rows of our databases. In one case I need to return some generated javascript code to pre-load a auto-suggest class. In the other case, I need to concatenate a variable number of comment postings for a given article "to create a threaded blog view" (the number of comments could get quite large).

My problem is that APEX is maxing out at 32767 characters. When I defined my function with a VARCHAR2(32767) I got a buffer too small error. When I tried to run it using a CLOB I got a "ORA-06502: PL/SQL: numeric or value error string". I'm assuming this happens when it tries to exit the PL/SQL function and return control back to APEX (some type of CLOB -> VARCHAR2 conversion - but once again i'm just guessing).

I tried to verify the code works fine by running it in sql developer. When using DBMS.OUTPUT.PUT_LINE I got the same ORA-06502 error. When I replaced the return string with a "function completed" message instead, it ran fine and printed out the success message.

To validate it wasn't the contents of the string, I changed the function to put a DBMS.OUTPUT.PUT_LINE on each iteration through the result sets that builds the large concatenated string. Every line printed without issue and no errors were generated...

So, my question is...how can I generate text > 32k in size and display it to the user through APEX?

Please don't respond and say that I shouldn't be loading that much into a webpage initially and that I should be using AJAX to search through values and load them on the fly. That could work for the select list (if I can get past APEX's very particular URL parsing system) but it is not suitable for the "blog comments" functionality.


Thanksss!!
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 6 2011
Added on Apr 8 2011
7 comments
1,278 views