This discussion is archived
3 Replies Latest reply: Jul 5, 2013 8:51 PM by RN RSS

Saving CLOBs

RN Newbie
Currently Being Moderated

I have been trying endlessly to make it work. Following all the great links available out there, still I am not able to save CLOBs into the db. Looks like the collection CLOB_CONTENT is not getting populated with user entered data.

 

http://stackoverflow.com/questions/11397456/saving-and-retreiving-clob-data-greater-than-32k-in-oracle-apex

 

 

https://forums.oracle.com/thread/725735

 

I have a form with an item (static field). I am able to populate it through clob_get function as described in above links. Now I also have clob_set JS function.

 

I tried different variations of this function as below :

function clob_set(){

var clob_ob = new apex.ajax.clob(

  function(){

   var rs = p.readyState

   if(rs == 1||rs == 2||rs == 3){

    $x_Show('AjaxLoading');

   }else if(rs == 4){

    $s('P3_CLOB',p.responseText);

    $x_Hide('AjaxLoading');

   }else{return false;}

  }

);

if(!$v_IsEmpty('P3_CLOB')){clob_ob._set($v('P3_CLOB'))};

}

 

 

function clob_set(request){

var oEditor = FCKeditorAPI.GetInstance('P3_CLOB');

var clob_ob = new apex.ajax.clob(

function(){

var rs = p.readyState

if(rs == 1||rs == 2||rs == 3){

$x_Show('AjaxLoading');

}else if(rs == 4){

$x_Hide('AjaxLoading');

$s('P3_CLOB', p.responseText);

doSubmit(request)

}else{return false;}

}

);

$x('P3_CLOB').value = oEditor.GetHTML();

oEditor.SetHTML('');

 

if(!$v_IsEmpty('P3_CLOB')){clob_ob._set($v('P3_CLOB'))};

}

 

Then I have a button with target to a URL with code as:

javascript:clob_set(); apex.submit('UPDATE');

 

Then I have a page process, which runs UPDATE on the table and is supposed to populate CLOB column with collection CLOB_CONTENT. But its not working. It does not work even for small data.

Does not look like the collection is even getting populated with the new data. Looks like it has data as used by clob_get() function.

I need to make it working for smaller data and then for data greater than 32k.

Please help me with detailed steps. I am not good at java scripts.

 

Thanks a lot!

RN

  • 1. Re: Saving CLOBs
    RN Newbie
    Currently Being Moderated

    I am using apex 4.0

    Please help!

     

    Thanks,

  • 2. Re: Saving CLOBs
    RN Newbie
    Currently Being Moderated

    Please help me. I am not getting that how clob_set() populates a collection? Is that collection CLOB_CONTENT?  What is wrong with clob_get() I am using? How can I call it ?

     

    I also see another code online, but what is P5075_STYLESHEET versus P5075_RESPONSETEXT? Why we use #  , e.g. #P5075_STYLESHEET

    I thought there is only one item which is HTML editor whose value we want to store in CLOB column.

    function clob_set(pSubmit){
      var clob_ob
    = new apex.ajax.clob(
      
    function(){
      var rs
    = p.readyState
      
    if(rs == 1||rs == 2||rs == 3){
      
    $x_Show('AjaxLoading');
      
    }else if(rs == 4){
      
    //here the clob has actually been saved, and
      
    // the ajax call finished
      
    $s('P5075_RESPONSETEXT',p.responseText);
      
    $x_Hide('AjaxLoading');

      
    //pSubmit is a new param
      
    //use it to check if set has been called for
      
    //a page submit or not
      
    if(pSubmit){
      
    //disable the clob field: it should not be
      
    //substituted to the session state!!
      
    $('#P5075_STYLESHEET').prop("disabled", true);
      
    //actually submit the page. This will submit
      
    //all fields to session except the disabled ones
      apex
    .submit('SUBMIT');
      
    };
      
    }else{
      
    return false;
      
    };
      
    });

      
    if(!$v_IsEmpty('P5075_STYLESHEET')){
      clob_ob
    ._set($v('P5075_STYLESHEET'));
      
    };
    };



    Thanks,

  • 3. Re: Saving CLOBs
    RN Newbie
    Currently Being Moderated

    Users,

    Please help me : I have been finally able to save as well as retrieve large data without any 32k limit. The javascript uses concept of clob_content. But that works for a page having one CLOB item. But my page has 3 CLOB items. How should I handle them: to save as well as retrieve? Please provide some guidance.

     

    Using apex 4.0 and CKEditor

     

     

    Thanks,

    RN

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points