Search This Blog

Sunday, October 23, 2022

Fetching and Parsing Data from Other Online Source To Oracle Database Using Web service in Oracle Apex

1. Create a table using the below code.

CREATE TABLE  "EMP_INFO" 
   ( "SERIAL" NUMBER, 
"GROUP_NAME" VARCHAR2(100), 
"EMP_NAME" VARCHAR2(100), 
"DESIGNATION" VARCHAR2(100), 
"MOBILE_NUMBER" VARCHAR2(20), 
"EMAIL_ADD" VARCHAR2(10)
)

2. Create a Page then Create a Region With Classic Report type. 

select * from EMP_INFO

3. Create a button like (Pull Data) to execute the process.

4. Create a Process and use the below code  

begin
insert into EMP_INFO
(SERIAL,GROUP_NAME,EMP_NAME,DESIGNATION,MOBILE_NUMBER,EMAIL_AD)select col001, col002, col003 , col004, col005, col006
from table
( apex_data_parser.parse
(  p_content=> apex_web_service.make_rest_request_b('https://raw.githubusercontent.com/Qaiums/Fatch-Data-From-Cloud-In-Oracle-Apex/main/emp_info.csv', 'GET')
, p_file_name=> 'emp_info.csv', p_skip_rows=> 1 )
);
end ;

5. Assign the button to execute the process. 


You can also Fetch and Parse from File Browser Item using APEX_DATA_PARSER. 

That's It...

No comments:

Post a Comment

Restrict File Upload by File Type in Oracle Apex

If you want to restrict file upload by file type/extension/format you can follow the below steps.  Goto File Browser Item --> Advanced --...