Display and Edit CLOB Content in Oracle APEX
In this post I will be explaining how to display and edit a CLOB content in Oracle APEX.
Please follow the below steps:
1) Create a table T_EMPLOYEE
2) Insert the required data into the T_EMPLOYEE table.
3) Create a page in the application. (In this example Page - 5)
4) Create another page with the Page Mode as Modal Dialog (In this example Page - 6)
5) Create a region and two items in Page - 6. The Items are:
P6_EMP_ID -> Type -> Hidden (Value Protected: No)
P6_EMP_DESCRIPTION -> Type -> Text Area (or) Rich Text Editor
6) Now navigate back to Page - 5 and create a Region (Type -> Interactive Report)
7) Paste the below code in the Source -> SQL Query of the Interactive Report
8) Go to the PREVIW column in the Interactive Report and change the Type to Link.
9) In the PREVIW column attributes:
- Go to Link - > Click on Target (Highlighted in red)
- Choose the Target Page as 6.
- Choose the Name as P6_EMP_ID and Value as EMP_ID.
10) Now navigate to Page - 6 and create an AJAX Callback process. Name it as FETCH_CLOB_DATA. Paste the below PL/SQL code:
11) Paste the below JavaScript code in the Execute When Page Loads section of Page - 6.
Steps 10 and 11 will fetch the CLOB data from the table and show it in the Front End.
12) Create a button in Page - 6 (In this example P6_SAVE)
13) Create an On Click Dynamic Action on the Button P6_SAVE.
14) Create a True Action -> Execute JavaScript Code and paste the below code
15) Create an AJAX Callback process. Name it as SAVE_DATA. Paste the below PL/SQL code.
Steps 14 and 15 will save the edited CLOB data into the table.
Reference: apex.server.chunk, apex.server.process
Click here for DEMO
Happy CODING!!!
Thank you
NUMBER = 4000, should be NUMBER := 4000
ReplyDeleteThank you very much for the help, this seems to work fine.
If i just need to display clob data, till step 10 it should be fine right?
ReplyDelete