Playing with Oracle REST Data Services (ORDS)

 

ordsI think it’s been about 18 months since I first wrote about installing ORDS 3, but since then I’ve done little more than dabble. For historical reasons, we are fronting APEX and exposing data as web services using Oracle HTTP Server and mod_plsql, which comes with its own set of pros and cons.

During the OTN Cloud Developer Day we were supposed to be using ORDS to expose our tables as web services, and my lack of ORDS experience was evident. 🙂 Since then I’ve been determined to take a proper look at ORDS. If you’ve been looking at the website homepage recently, you will know that process has started in earnest.

It’s by no means complete and the more I play with this stuff, the more rewriting I find myself doing, but I’m well on my way to understanding this stuff now.

For someone used to using mod_plsql and Data Access Descriptors (DADs), the authentication model and configuration of database connections in ORDS seems a little weird at first. I tied myself up in knots a few times before I understood it. While you’re getting to grips with this stuff, I would advise regularly flipping back to a clean VM snapshot, so you can approach things with a clean slate. I kept jumping to conclusions, only to find some of my results/issues were due to remnants of previous tests.

The official ORDS documentation is not the best. It’s like you need a decent grasp of the situation, or the documentation won’t make sense. Not that helpful when you’re coming to it fresh. 🙂 The documentation for the OAUTH and ORDS packages is pretty poor. I found myself just using trial and error to figure stuff out because stuff was just plain missing from the docs. I swear this is one of the examples.

Examples

The following example creates a .

EXECUTE ORDS.DEFINE_MODULE(

There are also things like this, which don’t really help.

Examples

The following example ...

EXECUTE ORDS.ENABLE_OBJECT((
   p_enabled      => ...,
   p_schema       => '...',
   p_object       => '...',
   p_object_type  => '...',
   p_object_slias => '...',
   p_auto_rest_auth => ...);

One of the last articles I did was the SQL Developer one, which in hindsight was a mistake. Some, but not all, of the SQL Developer screens allow you to see the package calls it is using to get the job done, which would have saved me a lot of time. Having said that, I probably learned a lot more because of the rough ride. 🙂

Like I said, I’m still learning so don’t give me a hard time if I’ve goofed up, but by all means drop me a line if you spot any mistakes and I’ll correct them. 🙂

Cheers

Tim…

PS. Jeff Smith just reminded me that SQLcl can export ORDS module definitions, so I’ve added it to the SQL Developer article here.

PPS. Added in the SODA functionality also.

Author: Tim...

DBA, Developer, Author, Trainer.