Marcelo
Marcelo

Reputation: 47

How to get data from REST API to Oracle DB

I need a way to read/get data from a REST API to insert it into a table in Oracle DB. I've been searching for it but I've only found the opposite case.

I'm using PL/SQL Developer & Postman Do i need another software ?

Thanks.

Upvotes: 2

Views: 9993

Answers (2)

Acroyear
Acroyear

Reputation: 1460

If you want to use UTL_HTTP, you can do something as simple as an INSERT ... SELECT ...

INSERT INTO my_table(response_data)
  SELECT utl_http.request('http://service.url.com')
  FROM   dual;

Upvotes: 3

thatjeffsmith
thatjeffsmith

Reputation: 22457

One way to go is with Oracle REST Data Services (ORDS).

It's a mid-tier Java application (or servlet with Tomcat/WebLogic) that takes HTTP(S) requests and marshalls that to the Oracle Database.

It handles GETs, PUTs, POSTs, & DELETEs so you can definitely use it to INSERT one or more rows to a TABLE. And it can do that via a SQL statement, or an existing PLSQL API.

I talk more about this here.

Here's a REST Service that let's you POST a new record to a TABLE, including a BLOB (file).

This technology is included with your Oracle Database license at no additional cost.

enter image description here

Upvotes: 3

Related Questions