Retrieving Query Status

The service operation QAS_QUERYSTATUS_OPER is used to return the status of query execution. This service operation returns the QAS status, not the Process Scheduler status.

See Viewing the Status of Processes.

This service operation returns current query status.

Request Message: QAS_QUERYSTATUS_REQ_MSG

Element Name

Description

QueryInstanceID

Query instance ID.

Example Request:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:qas="http://xmlns.oracle.com/Enterprise/Tools/schemas/
QAS_QUERYSTATUS_REQ_MSG.VERSION_1"
xmlns:qas1="http://xmlns.oracle.com/Enterprise/Tools/schemas/
QAS_QUERYSTATUS_REQ.VERSION_1">
   <soapenv:Header/>
   <soapenv:Body>
      <qas:QAS_QUERYSTATUS_REQ_MSG>
         <qas:QAS_QUERYSTATUS_REQ>
            <qas1:PTQASWRK class="R">
               <qas1:QueryInstanceID>
                    64ef3e36-5cf6-11dd-a1b6-cf9c0ed84831
               </qas1:QueryInstanceID>
            </qas1:PTQASWRK>
         </qas:QAS_QUERYSTATUS_REQ>
      </qas:QAS_QUERYSTATUS_REQ_MSG>
   </soapenv:Body>
</soapenv:Envelope>

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:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
   <soapenv:Body>
      <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>running</Status>
               <NumColumns>0</NumColumns>
               <TotalBlocks>0</TotalBlocks>
               <TotalBytes>0</TotalBytes>
               <TotalRows>0</TotalRows>
            </PTQASSTATWRK>
         </QAS_QUERYSTATUS_RESP>
      </QAS_QUERYSTATUS_RESP_MSG>
   </soapenv:Body>
</soapenv:Envelope>

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 of an URI template

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

  • getstatus?instanceid={QueryInstanceID}

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}}