Query tables data.
post
/pds/rest-service/dataservice/runquery
Send a request to this endpoint to query databases registerd with Primavera data service. This endpoint returns either jobId or query results including with pagination, sinceDate, generated SQL query, current page record count and total records count.
Request
Supported Media Types
- application/json
Query Parameters
-
configCode: string
The configuration name.
The query details in json format.
Root Schema : QueryObject
Type:
object
The input object to fetch table data.
Show Source
-
mode(optional):
string
Allowed Values:
[ "SYNC", "ASYNC", "BLOB_COLUMNS" ]
A type of execution -
name(optional):
string
Query identifier.
-
nextKey(optional):
string
First row number and this will required only for pagination, fetch this value from previous pagination query response. A value "-1" indicates no more data on server.
-
nextTableName(optional):
string
Table Name.This will required only for pagination with multiple tables,fetch this value from previous pagination query response. A value "-1" indicates no more data on server.
-
pageSize(optional):
string
Specifies how many rows should return from this query.
-
sinceDate(optional):
string
A database date that the query fetches rows created/updated after this date.
-
sqlQueriesAndTotalRecordCount(optional):
boolean
Generated sql queries and total count from request body. By default this will be disabled(false).
-
tables:
array tables
A list of queries for tables.
Nested Schema : tables
Type:
array
A list of queries for tables.
Show Source
Example:
"tables": [ { "tableName": "Activity", "columns": [ "ACTIVITY_ID", "Name", "ACTIVITY_TYPE", "STATUS", "START_DATE", "Finish" ], "condition": { "operator": "AND", "conditions": [ { "columnName": "Planned Duration", "operator": "GREATER_THAN_OR_EQUALS", "value1": "1200" }, { "columnName": "PROJ_ID", "operator": "EQUALS", "value1": "1" } ] } } ]
Nested Schema : TableQuery
Type:
Show Source
object
-
columns:
array columns
A comma separated list of columns.
-
condition(optional):
object The criteria of the query
-
joinCondition(optional):
object The criteria of the query
-
joinedTables(optional):
array joinedTables
Joined tables.
-
tableName:
string
The table name.
Nested Schema : The criteria of the query
Type:
Show Source
object
-
columnName(optional):
string
The column name. This property is ignored when the operator is AND/OR.
-
columnName1(optional):
string
The column name. This property is ignored when the operator is AND/OR.
-
columnName2(optional):
string
The column name from joined table. right column. This property is ignored for normal condition
-
conditions(optional):
array conditions
List of Conditions if the operator is AND/OR.
-
joinConditions(optional):
array joinConditions
List of Join Conditions with operator AND for an inner table
-
operator(optional):
string
Allowed Values:
[ "AND", "OR", "IS_NULL", "IS_NOT_NULL", "EQUALS", "NOT_EQUALS", "GREATER_THAN", "LESS_THAN", "GREATER_THAN_OR_EQUALS", "LESS_THAN_OR_EQUALS", "BETWEEN" ]
The condition operator. -
sqlFunction(optional):
string
-
value1(optional):
string
The first value of the criteria. When the operator is AND/OR/IS_NULL/IS_NOT_NULL, this property is ignored.
-
value2(optional):
string
The second value of the criteria. This property is used only when the operator is BETWEEN.
Nested Schema : joinConditions
Type:
array
List of Join Conditions with operator AND for an inner table
Show Source
Response
Supported Media Types
- application/json
200 Response
successful operation
Root Schema : DataObject
Type:
object
The response entity.
Show Source
-
data(optional):
object data
Additional Properties Allowed: additionalPropertiesThe query response which contains pagination and sinceDate details.This will exists in response only if the mode is SYNC.
-
jobId(optional):
string(uuid)
The unique identifier for the background service. This will exists in response only if the mode is either ASYNC or BLOB_COLUMNS.
Nested Schema : data
Type:
object
Additional Properties Allowed
Show Source
The query response which contains pagination and sinceDate details.This will exists in response only if the mode is SYNC.
Nested Schema : additionalProperties
Type:
Show Source
array
-
Array of:
object items
Additional Properties Allowed: additionalProperties
202 Response
Request Accepted
400 Response
Bad Request
500 Response
Internal Server Error
503 Response
Service Unavailable