Skip to Main Content

SQL & PL/SQL

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!

Insert REST API Call to staging table

Mohammed RafiDec 9 2021

Hi,
I am able to GET the response from REST API call using the below code
declare
v_response clob;
v_buffer varchar2(32767);
v_buffer_size number := 32000;
v_offset number := 1;
begin
-- Set connection and invoke REST API.
v_response := apex_web_service.make_rest_request(
p_url => 'https://abc-dev1.fa.emx.oraclecloud.com/hcmRestApi/resources/11.13.18.05/majorsLOV?q=LookupType=BLOOD_TYPE',
p_http_method => 'GET',
p_username => 'xxx@gmail.com',
p_password => 'Rest@12345'
--p_body => '{"LookupType":"BLOOD_TYPE"}'
);

-- Get response.
begin
loop
dbms_lob.read(v_response, v_buffer_size, v_offset, v_buffer);
-- Do something with buffer.
DBMS_OUTPUT.PUT_LINE(v_buffer);
v_offset := v_offset + v_buffer_size;
end loop;
exception
when no_data_found then
null;
end;
end;
In the response I receive lookup type, lookup code, description and meaning andI would like to know how can I parse and insert into staging table
Thanks

Comments
Post Details
Added on Dec 9 2021
5 comments
525 views