Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

send json to ajaxcallback process

Massimo De VitisMar 27 2024 — edited Mar 27 2024

hi, I created an ajaxcallback process in which I execute a pls/sql code and I wanted to know 2 things:

is it possible to send json data ?

is it possible to process json data in pl/sql code?

this is my client code:

saveData = function(){
let model = {};
let data = {};
let formData = $('#wwvFlowForm').serializeArray();
let count = 1;
model.x01 = JSON.stringify(formData);
console.log(model.x01);
console.log(data);
apex.server.process(
'SAVE_DATA_PAZIENTE',
model,
{
dataType: 'json',
success: function(data){
console.log(data);
apex.message.showPageSuccess(data);
},
error: function(error){
apex.message.alert(error.responseText);
}
}
);
};

this is my server code:

declare
l_clob clob;
begin
l_clob := APEX_APPLICATION.G_X01;
apex_json.parse(
p_source => l_clob );
dbms_output.put_line('json: ' || l_clob);
raise_application_error(-20000, APEX_APPLICATION.G_X01);
end;

Best regards

Comments
Post Details
Added on Mar 27 2024
5 comments
1,276 views