Home > OS >  How to pass JSON array in PLSQL Rest Service
How to pass JSON array in PLSQL Rest Service

Time:02-19

I am trying to pass JSON array in Rest Service in EBS (12.2.10) but getting following error:

"-40491 ORA-40491: invalid input data type for JSON_TABLE"

I created following types:

CREATE OR REPLACE EDITIONABLE TYPE XRCL_CB_INBOUND_TALLY_OBJ AS OBJECT
(TRANSACTION_DATE VARCHAR2(30),
 TRANSACTION_TYPE VARCHAR2(5),
 ORGANIZATION_ID  VARCHAR2(5),
 DOCUMENT_ID      VARCHAR2(25),
 DOCUMENT_LINE_ID VARCHAR2(25),
 SKU_CODE         VARCHAR2(25),
 QUANTITY         VARCHAR2(10),
 SUBINVENTORY     VARCHAR2(25),
 LOT_NUMBER       VARCHAR2(25));

CREATE OR REPLACE EDITIONABLE TYPE XRCL_CB_INBOUND_TALLY_NT AS TABLE OF XRCL_CB_INBOUND_TALLY_OBJ;

Below is my json object which I am passing as parameter:

    {
    "TALLYQUANTITY_Input": {
        "RESTHeader": {
            "Responsibility": "ROCELL",
            "RespApplication": "XRCL",
            "SecurityGroup": "STANDARD",
            "NLSLanguage": "AMERICAN"
        },
        "InputParameters": {
            "P_TRANSACTION_LINES": [
                {
                    "TRANSACTION_TYPE": "IO",
                    "TRANSACTION_DATE": "01/02/2022 12:00:00 AM",
                    "ORGANIZATION_ID": "121`enter code here`",
                    "DOCUMENT_ID": "1",
                    "DOCUMENT_LINE_ID": "1",
                    "SKU_CODE": "RC.001.000102.MA.03",
                    "QUANTITY": "1",
                    "LOT_NUMBER": "1013A.B.7.J.G",
                    "SUBINVENTORY": "Saleable"
                }
            ]
        }
    }
}

CodePudding user response:

Issue resolved by passing parameters in same order as defined in xsd sequence tag

  • Related