How to show clob content in oracle apex page ? is it possible to show ?
Yes, Possible to print clob content in oracle apex page with using of PL/SQL Dynamic Content Region.
Step 1: Split CLOB content into small pieces of content with using of dbms_lob.read procedure.
Example Code Snippet:
DECLARE
CURSOR crec IS
SELECT
html_message
FROM
mails_t
WHERE
email_id = 1001;
rrec crec%rowtype;
l_amt INTEGER := 4000;
l_pos INTEGER := 1;
l_buf VARCHAR2(32000);
BEGIN
OPEN crec;
FETCH crec INTO rrec;
CLOSE crec;
LOOP
BEGIN
dbms_lob.read(rrec.html_message, l_amt, l_pos, l_buf); /* Splitting the CLOB Content with buffer size */
l_pos := l_pos + l_amt;
l_amt := 4000;
htp.p(l_buf); /* Print Content */
EXCEPTION
WHEN no_data_found THEN
EXIT;
END;
END LOOP;
END;
Step 2: Create PL/SQL Dynamic content region and enter above Pl/SQL code. It can split the clob content into bits and pieces of content and then print the content in Apex Page.
Happy Apexing!