Hello guys!
I have the following code under "HTML Header and Body Attribute" of the page which is used to save CLOB into database from textarea and retrieve it into the textarea. I am using this due to the 32k limit.
<script language="JavaScript" type="text/javascript">
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('P2_CLOB',p.responseText);
$x_Hide('AjaxLoading');
}else{return false;}
}
);
if(!$v_IsEmpty('P2_CLOB')){clob_ob._set($v('P2_CLOB'))};
}
function clob_get(){
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('P2_CLOB',p.responseText);
$x_Hide('AjaxLoading');
}else{return false;}
}
);
clob_ob._get();
}
</script>
I am calling one of the functions under "Page HTML Body Attribute" as
onload = "javascript:clob_get();"
I have a PLSQL after header process for this.
declare
l_clob clob:= empty_clob();
begin
apex_collection.create_or_truncate_collection(p_collection_name=>'CLOB_CONTENT');
dbms_lob.createtemporary( l_clob, false, dbms_lob.SESSION );
SELECT clob_column
INTO l_clob
FROM my_table
WHERE namn = 'abc';
apex_collection.add_member(p_collection_name => 'CLOB_CONTENT',p_clob001 => l_clob);
end;
This is working just fine. Now, I have a plsql process which saves the details entered in some textfields on the same page and saves it into the database. After I introduced this javascript call, it has stopped working. I get a "*HTTP Bad Request*".
Can anyone please explain why is this happening and how can i solve this? Any inputs are highly appreciated.
Thanks!
Edited by: gaurav_ojha on Jul 10, 2012 1:19 AM
Edited by: gaurav_ojha on Jul 10, 2012 1:21 AM
Edited by: gaurav_ojha on Jul 10, 2012 1:23 AM
Edited by: gaurav_ojha on Jul 10, 2012 1:24 AM