One problem with APEX is it has issues with dealing with text values of greater than 32k, while there is a fairly simple workaround it does have quite a few pieces and there has to be an easier way to do it.

Well in APEX 3.1 there is now an integrated javascript call to take care of this. This example also shows some of our new namespaced javascript objects and functions.

I've created a working example here.

Setting the CLOB

What's happening in the previous piece of javascript is I'm creating a apex.ajax.clob object. This object only takes one parameter when being initialized which is a function , or pointer to a function, to call when the XMLHTTP object's readyState changes. In that return function ,and for all built in APEX asynchronous AJAX calls, p is the XMLHTTP object.

Once the apex.ajax.clob object is created you just call set method giving it a string ._set(String Value);

It will automatically create a collection in your session CLOB_CONTENT and populate the CLOB001 column.

You can then use that in a page or application level process , usually by calling a doSubmit() and submitting the page.

The p.responseText on successful population of the CLOB will be SUCCESS.

Getting the CLOB

Getting a CLOB is much the same as setting one. Create the apex.ajax.clob object setting the function to call when p.readyState and then call the ._get() method which doesn't take any parameters.

This solution only deals with one clob at a time and the clob is alway put into the CLOB_CONTENT collection, though dealing with multiple clobs is also much easier, more on that later ;). But it is much easier to work with than the old workaround.

I just watched 2001: A Space Odyssey in the last week in HD. If you've never seen or it's been awhile or never seen it in HD do yourself a favor and check it out it's an amazing movie, though it looks like they were a little off on the dates.


  1. Dan said...
    Thank you for the post... most helpful! I'll be looking into this more over the weekend.
    jona said...
    Works well with IE but not in Firefox. Is it right or is it a problem from me?
    Dimitri Gielis said...
    Nice post Carl!
    Carl Backstrom said...

    Should work in both, in fact I never even tested it in IE only in FF, and I've checked on both Linux and Win, are you getting an error message?


    Thanks, I was helping someone with CLOB entry on forum and remembered oh yeah we have the new helper object.
    jona said...
    Sorry, it works now, i don't know why it didn't a few hours ago...
    Thanks for your very helpful blog!
    Paulo Vale said...
    Hi Carl,
    What do you use in your blog to format the code?

    Matt said...
    I've seen your forum posts on extending the previous workaround for multiple clobs, can you detail how to extend this shortcut for multiple clobs? Also where would I put the call to doSubmit, if I wanted to submit the page (and update non-clob fields)?

    Daniel said...
    The post is fantastic, thank you.

    Howevere, I have one question, could you let me know how do I gain access to the session CLOB_CONTENT and the populated CLOB001 via code in a procedure or tigger in the DB?


    iris said...
    I'm straggling with this for about a week now , can you please tell me what I'm doing wrong .
    Can I email you my app (one page)?

    I keep getting empty p.responseText

    Thanks in advance
    Iris hadar
    Israel antiquities authority
    iris said...
    i forgot to give my email
    pay per head call center said...
    Thank you for sharing to us.there are many person searching about that now they will find enough resources by your post.I would like to join your blog anyway so please continue sharing with us
    malini ecorp said...
    Thanks for sharing this useful info. Keep updating

    same way.
    Regards,Siddu Corporate Training
    Fernando said...
    Daniel, this way you get the collection from plsql:

    l_clob CLOB;
    clob001 INTO l_clob
    FROM apex_collections
    WHERE collection_name = 'CLOB_CONTENT';
    --do something
    Bluehost Coupon Code said...
    Good to see with sharing information..
    wasirdenature said...
    lionelmessi10 said...
    jaring pengaman said...
    حسام داود said...
    Priyanka Soni said...
    We are offering Dell Boomi Online Training with latest techniques. Our experts have more than 8 years experienced and certified.
    Dell Boomi Online Training
    Shirley Parmar said...
    Nice Information... Thank you
    Oracle Fusion said...
    Thanks for your Quality information; the product developed by the company is perfect. Thanks for giving such a wonderful article....................
    R12 SCM Training
    oracle procurement said...

    your article is good.In this article contains very informative data
    thanks for sharing having this article.
    oracle fusion procurement online training
    Calfre India said...
    I really appreciate information shared above. It’s of great help. If someone want to learn Online (Virtual) instructor lead live training in Oracle Fusion Financials online Training , World Class Virtual Instructor led training on Oracle fusion Financials Online Training. We have industry expert trainer. We provide Training Material and Software Support. calfre has successfully conducted 100000+ trainings in India, USA, UK, Australlia,
    Switzerland, Qatar, Saudi Arabia, Bangladesh, Bahrain and UAE etc.

    For Demo Contact us:

    Contact No.-+91-9666183940, 8886096632
    USA Contact no: +646 491 6833
    Company Website –
    Sandeep Oracle said...
    Wow, this blog is very nice I really like your blog and Impressive thank you very much for posting this blog.........Get some more information about Oracle Fusion Related Course can Click here.
    Unknown said...
    I can see that you are putting a lots of efforts into your blog. Keep posting the good work.Some really helpful information in there. Bookmarked. Nice to see your site. Thanks!
    obat herbal untuk gatal eksim
    cara mengobati eksim
    harga obat eksim
    obat eksim manjur dan paten
    obat eksim paling murah
    dimana bisa beli obat untuk gatal eksim
    jual obat untuk gatal eksim
    obat eksim di jakarta
    mahi eswari said...
    Thanks for sharing the details!
    Cognos training in hyderabad
    desain rumah said...
    thanks for sharing good article
    its very useful article
    jasa desain rumah
    Rainbow Training Institute said...
    Thanks for sharing valuable article having good information and also gain worthful knowledge.

    Oracle Integration cloud service online training

    Rainbow Training Institute said...
    Thank you for sharing your awesome and valuable article this is the best blog for the students they can also learn.

    Workday HCM Online Training

    Rainbow Training Institute said...
    Thanks for providing a useful article containing valuable information. start learning the best online software courses.

    Workday Online Training

    shivani said...
    An overwhelming web journal I visit this blog, it's unfathomably amazing. Unusually, in this present blog's substance made inspiration driving truth and reasonable. The substance of data is enlightening
    Oracle Fusion Financials Online Training
    Oracle Fusion HCM Online Training
    Oracle Fusion SCM Online Training
    Rainbow Training Institute said...
    Such a nice blog, I really like what you write in this blog, I also have some relevant Information about if you want more information.

    Workday HCM Online Training
    Rainbow Training Institute said...
    Thank you for sharing such a nice and interesting blog and really very helpful article

    Workday Online Training
    Rainbow Training Institute said...
    Very interesting blog Really excellent information and thank you for giving your valuable information

    Oracle Fusion HCM Online Training

Post a Comment