Skip to Main Content
  • Questions
  • Best way to access Oracle Cloud Infrastructure from PL/SQL in an premise Database

Breadcrumb

Question and Answer

Connor McDonald

Thanks for the question, Dieter.

Asked: January 08, 2024 - 8:52 am UTC

Last updated: January 15, 2024 - 5:12 am UTC

Version: Oracle Database 19c

Viewed 1000+ times

You Asked

I'm exploring the use of the OCI Document Understanding Services and do need to access the API from our PL/SQL backend.
Although there are OCI SDK's for several languages none seems to allow it's use from PL/SQL.
What is the best way to use OCI services from PL/SQL?

and Connor said...

head over to this Livelab

https://apexapps.oracle.com/pls/apex/r/dbpm/livelabs/run-workshop?p210_wid=3585

Lab 3 is about how to use the API via REST.

Anything you can access via REST you can access from the database via UTL_HTTP. However, I'd recommend the easier way would be to use APEX_WEB_SERVICE which is a layer on top of UTL_HTTP which makes a lot of this easier.


Rating

  (1 rating)

Comments

PL/SQL example and documentation

Dieter Oberkofler, January 11, 2024 - 4:09 pm UTC

It is my understanding that directly using the REST API using UTL_HTTP is your recommendation.
Unfortunately the livelab does not use PL/SQL but postman and I did not find any documentation or examples on how to actually use (and especially authenticate) whin OCI services when only using REST calls.
Connor McDonald
January 15, 2024 - 5:12 am UTC

Authentication is done with a wallet as per normal.

But check out APEX_EXEC as per this post from Jon Dixon. It will make the authentication process a lot easier

https://www.jmjcloud.com/blog/simplifying-apex_web_service-oauth2-client-credentials