One of the coolest features of Oracle REST Data Services v3.0 and higher, is the ability to REST enable your Oracle tables and views.

You get a full REST api on your table – INSERT, UPDATE, DELETE, Select with or without predicates and sorting, and getting metadata. You can also batch load records.

I’ve talked about the SELECT and GET bits before.

What I’m going to show today is how to POST (INSERT) up a new record without writing any SQL.


You have Oracle REST Data Services v3 or higher running.

You have REST enabled your Schema.

Your table has a primary key.

You have REST enabled your table.

REST enabled, check. Primary key, check.
REST enabled, check. Primary key, check.

Ok, let’s post up a new record.

The docs show us how. Insert Table Row
This example inserts data into the object. The body data supplied with the request is a JSON object containing the data to be inserted.

If the object has a primary key, then there must be an insert trigger on the object that populates the primary key fields. If the table does not have a primary key, then the ROWID of the row will be used as the item’s identifier.

If the object lacks a trigger to assign primary key values, then the PUT operation described in Update/Insert Table Row should be used instead.

Pattern: POST http://:/ords///


POST http://localhost:8080/ords/ordstest/emp/
Content-Type: application/json

{ “empno” :7, “ename”: “JBOND”, “job”:”SPY”, “deptno” :11 }

So let’s go do that.

Don't forget to set the content type!
Don’t forget to set the content type!

Now in the ‘religion’ of REST, everything is about the hyperlinks.

So what will our response be?

So, let's go GET it.
So, let’s go GET it.

Here’s the record.


A Few More Things

These are simple data types. We support complex ones too, including SPATIAL and GEO-JSON. You’ll need the latest version of ORDS for this.

You can upload multiple records too.

And I can UPDATE my existing record 🙂

PUT, not POST. And you supply the record in the URI via the PK value.
PUT, not POST. And you supply the record in the URI via the PK value.

I'm a Master Product Manager at Oracle for Oracle SQL Developer. My mission is to help you and your company be more efficient with our database tools.


  1. Hi Jeff,

    I have been testing ORDS out for use within our ORG. For right now, I have been able to install REST, autoREST enable the schema and autoREST enable the tables. In the setup that I have a user called restUser which is supposed to be the generic user account on which is REST services are enabled.

    How do I do gets and puts using restUser account on tables owned by HR schema? Do I need to create views or synonyms?

    Thanks and Regrds

    • thatjeffsmith

      Is restUser and ORDS/Jetty user with ‘sql developer’ role, or is restUser a database user?

  2. For ORDS, can we authenticate against Db table directly as we can do in apex authentication scheme? I would like to reuse the same login table for both apex apps & ORDS authentication .

  3. Since the doc says: “there must be an insert trigger on the object that populates the primary key fields” – is it assuming the PK is an integer, surrogate key or identity column with an associated sequence?

  4. Thanks,
    I think a very critical missing feature is custom authentication on ORDS.

    • thatjeffsmith

      how do you mean custom? We allow you to authenticate MANY different ways. Single sign-on, 3rd party OAUTH2, database…

Write A Comment