Operation
post /esmSQLQueryService/getSQLQueryResult
getSQLQueryResult (getSQLQueryResult : /esmSQLQueryService/getSQLQueryResult)
This operation provides the execution result of native Sql queries.
Disclaimer:
- This API should be used only if there are no other API available for equivalent functionality, and should be used only by expert users who understand the internals of OMS DB model.
- Internal DB model of OMS is subject to change across the releases and no guarantee of backward compatibility.
- In particular, executing SQL DML statements like INSERT/UPDATE/DELETE/MERGE should be avoided. Improper updates may render the system unusable. or it might even impact the performance of the system
Request body
Name |
IsRequired |
Description |
Data Type |
Enum |
---|---|---|---|---|
body | required | Sql Query request data | SqlQueryRequest |
--- |
Return type
Responses
Response Messages |
Schema |
---|---|
200success |
SqlQueryResult
|
201Created | --- |
401Unauthorized | --- |
403Forbidden | --- |
404Not Found | --- |
Consumes
This API call consumes the following media types via the Content-Type request header:
application/json
Example Request Data
{ "sqlQuery" : "select EVS.VSID , EVS.EHNAME, EERP.RINGID from ESM_E_VS EVS, ESM_E_ERP EERP WHERE EERP.VSID = EVS.VSID" , "queryType" : "get" }
Produces
This API call produces the following media types according to the Accept request header;
the media type will be conveyed by the Content-Type response header.
application/json
Example Response Data
{ "sqlQuery": "select EVS.VSID , EVS.EHNAME, EERP.RINGID from ESM_E_VS EVS, ESM_E_ERP EERP WHERE EERP.VSID = EVS.VSID" "sqlQueryResult": "Success" "errorString": null "sqlJSONResult": [36] -0: { "EHNAME": "/shelf=2/slot=7" "VSID": 9 "RINGID": 4 } -1: { "EHNAME": "/shelf=2/slot=7" "VSID": 9 "RINGID": 1 } -2:{ "EHNAME": "/shelf=2/slot=7" "VSID": 9 "RINGID": 2 } -3:{ "EHNAME": "/shelf=2/slot=7" "VSID": 9 "RINGID": 3 } -4: { "EHNAME": "/shelf=2/slot=3" "VSID": 10 "RINGID": 1 } -5: { "EHNAME": "/shelf=2/slot=10" "VSID": 11 "RINGID": 1 } }
External Docs
See Also :
SqlQueryResult
Name |
Type |
Description |
Enum |
---|---|---|---|
sqlQuery | String string |
Native Sql query to be executed. | --- |
sqlQueryResult | String string |
Response data of native Sql query executed. | --- |
errorString | String string |
Error response in case of failed sql query execution | --- |
sqlJSONResult | array[Map«string,object»] Map«string,object» |
The Select query result in a JSON format; in rest of the cases it shows null | --- |