ORDS:POST Operation for Inserting Data Returns HTTP 404 Code if the Target Table has Two or More Primary Keys
(Doc ID 2668775.1)
Last updated on AUGUST 09, 2022
Applies to:
Oracle REST Data Services - Version 19.2 and laterInformation in this document applies to any platform.
Symptoms
On : 19.2 version, All Issues
The POST operation for inserting data returns HTTP 404 code if the target table has two or more primary keys. Even the HTTP 404 error is returned the data itself was inserted correctly in the table.
Inserts are successful (HTTP 201) if the table has only one primary key.
ERROR
-----------------------
HTTP/1.1 404 Not Found
DISCLAIMER: The example(s) provided are for demonstration purposes only and represents fictitious data. Any similarity to actual data, web sites and / or persons, living or dead, is purely coincidental and not intended in any manner.
STEPS
-----------------------
Table info:
--
CREATE TABLE ORDSTEST.TESTTABLE
(COL1 VARCHAR2(10) NOT NULL,
COL2 VARCHAR2(10) NOT NULL,
COL3 VARCHAR2(12),
CONSTRAINT APITEST2_PK PRIMARY KEY(COL1, COL2) USING INDEX
);
result:
--
$ curl -i -H "Content-Type: application/json" -X POST -d "{ \"col1\" :\"LASTNAME\", \"col2\": \"FIRSTNAME\", \"col3\": \"AAAAA\" }" "http://<ords host>:<port>/ords/ordstest/testtable/"
HTTP/1.1 404 Not Found -----> Returned with HTTP 404 error.
After the REST request, the data is inserted in spite of the HTTP 404 error.
--
SQL> select * from TESTTABLE;
COL1 COL2 COL3
---------- ---------- ------------
LASTNAME FIRSTNAME AAAAA
Changes
Reported as <BUG 30907038> - ORDS POST OPERATION FOR DATA INSERT RETURNS HTTP 404 IF THE TABLE HAS TWO PK.
Cause
To view full details, sign in with your My Oracle Support account. |
|
Don't have a My Oracle Support account? Click to get started! |
In this Document
Symptoms |
Changes |
Cause |
Solution |
References |