QAS_QUERYSTATUS_REST_GET

This service operation returns the QAS status of query execution.

Request Message: QAS_QUERYSTATUS_TEMPL

Element Name Description

QueryInstanceID

Query instance ID. It is a required variable.

json_response

Enter true for JSON response type; enter false for standard XML response. If no value is provided, the default is standard XML response.

Example 4-12 Example of an URI template

  • getstatus?instanceid={QueryInstanceID}&json_resp={json_response}

  • getstatus?instanceid={QueryInstanceID}

Example 4-13 Example Request:

https://<servername>:<port>/PSIGW/RESTListeningConnector/<defaultlocal node>/QueryStatus.v1/getstatus?instanceid=7d40d78f-2fae-11e3-95a9-8782b6a978ba

Response Message: QAS_QUERYSTATUS_RESP_MSG

Element Name Description

Status

Returns query status. Values are:

  • idNotFound

  • running

  • killed

  • posting

  • last

  • queued

  • success

  • error

NumCols

Number of columns.

TotalRows

Total number of rows.

TotalBlocks

Always returns 0.

TotalBytes

Total number of bytes.

Example Response:

<?xml version="1.0"?>
<QAS_QUERYSTATUS_RESP_MSG xmlns="http://xmlns.oracle.com/Enterprise/
Tools/schemas/QAS_QUERYSTATUS_RESP_MSG.VERSION_1">
    <QAS_QUERYSTATUS_RESP>
        <PTQASSTATWRK class="R" xmlns="http://xmlns.oracle.com/Enterprise/
        Tools/schemas/QAS_QUERYSTATUS_RESP.VERSION_1">
            <Status>queued</Status>
            <NumColumns>4</NumColumns>
            <TotalBlocks>212</TotalBlocks>
            <TotalBytes>5940</TotalBytes>
            <TotalRows>0</TotalRows>
        </PTQASSTATWRK>
    </QAS_QUERYSTATUS_RESP>
</QAS_QUERYSTATUS_RESP_MSG>

Sequel to the response above:

<?xml version="1.0"?>
<QAS_QUERYSTATUS_RESP_MSG xmlns="http://xmlns.oracle.com/Enterprise/
Tools/schemas/QAS_QUERYSTATUS_RESP_MSG.VERSION_1">
    <QAS_QUERYSTATUS_RESP>
        <PTQASSTATWRK class="R" xmlns="http://xmlns.oracle.com/Enterprise/
         Tools/schemas/QAS_QUERYSTATUS_RESP.VERSION_1">
            <Status>success</Status>
            <NumColumns>4</NumColumns>
            <TotalBlocks>212</TotalBlocks>
            <TotalBytes>5940</TotalBytes>
            <TotalRows>0</TotalRows>
        </PTQASSTATWRK>
    </QAS_QUERYSTATUS_RESP>
</QAS_QUERYSTATUS_RESP_MSG>

Example Request using json_resp = true:

  1. Run the QAS_EXECUTEQRYPOLL_REST_GET.

  2. Following successful response, take the provided instance ID and use it in QAS_GETQUERYRESULTS_REST_GET request.

  3. The sequence of responses that will generate is:

    1. First,

      {"status": "success","data": {"status": "queued","numColumns": 0,"totalBlocks": 0,"totalBytes": 0,"totalRows": 0}}
    2. After sometime,

      {"status": "success","data": {"status": "running","numColumns": 4,"totalBlocks": 
      0,"totalBytes": 0,"totalRows": 0}}
    3. Finally,

      {"status": "success","data": {"status": "success","numColumns": 4,"totalBlocks": 0,"totalBytes": 
      122,"totalRows": 1140}}