Retrieving Query Results
The service operation QAS_GETQUERYRESULTS_OPER is used only to retrieve the query results for the QAS_EXECUTEQRYSYNCPOLL_OPER service call.
Query results are stored either in message segments or in a file such as, XML, HTM, XLS, JSON. Segments can contain rows of data (nonrowset-based messages). When the query result is stored in a file, QAS will return the URL of the file location.
This service operation is used to retrieve the query results.
Request Message: QAS_GETQUERYRESULTS_REQ_MSG
Element Name |
Description |
---|---|
BlockNumber |
The number of blocks to be retrieved. Query result is retrieved starting from block 1 in sequential order until the final block is retrieved. Note: The block that contains status finalBlockRetrieved is the final block. |
QueryInstance |
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_GETQUERYRESULTS_REQ_MSG.VERSION_1"
xmlns:qas1="http://xmlns.oracle.com/Enterprise/Tools/schemas/
QAS_GETQUERYRESULTS_REQ.VERSION_1">
<soapenv:Header/>
<soapenv:Body>
<qas:QAS_GETQUERYRESULTS_REQ_MSG>
<!--Zero or more repetitions:-->
<qas:QAS_GETQUERYRESULTS_REQ>
<qas1:PTQASWRK class="R">
<qas1:BlockNumber>1</qas1:BlockNumber>
<qas1:QueryInstance>
8995a01e-0a75-11dd-9c24-98a15db6aa18
</qas1:QueryInstance>
</qas1:PTQASWRK>
</qas:QAS_GETQUERYRESULTS_REQ>
</qas:QAS_GETQUERYRESULTS_REQ_MSG>
</soapenv:Body>
</soapenv:Envelope>
Response Message: QAS_GETQUERYRESULTS_RESP_MSG
Depending on the output format requested, the response will be either a file URL or the query result in webrowset or XMLP format.
Element Name |
Description |
---|---|
FILEURL |
Returns FILE URL. |
status |
If the output format is file, the return status will be either success orfailure. If the output format is non file the return status will be one of the following:
|
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_GETQUERYRESULTS_RESP_MSG xmlns="http://xmlns.oracle.com/
Enterprise/Tools/schemas/QAS_GETQUERYRESULTS_RESP_MSG.VERSION_1">
<QAS_QUERYRESULTS_FILE_RESP xmlns="http://xmlns.oracle.com/
Enterprise/Tools/schemas/QAS_QUERYRESULTS_FILE_RESP.VERSION_1">
<FILEURL>
http://ple-infodev-09.example.com:8010/psreports/QEDMO /9999911/XRFWIN.xml
</FILEURL>
<status>success</status>
</QAS_QUERYRESULTS_FILE_RESP>
</QAS_GETQUERYRESULTS_RESP_MSG>
</soapenv:Body>
</soapenv:Envelope>
This service operation is used only to retrieve the query results for the QAS_EXECUTEQRYPOLL_REST_GET service call. Query results are stored either in message segments or in a file. Segments can contain rows of data (nonrowset-based messages). When the query result is stored in a file, QAS will return the URL of the file location.
Request Message: QAS_GETQUERYRESULTS_TEMPL
Element Name |
Description |
---|---|
BlockNumber |
The number of blocks to be retrieved. It is a required variable. Query result is retrieved starting from block 1 in sequential order until the final block is retrieved. Note: The block that contains status finalBlockRetrieved is the final block. |
QueryInstance |
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
getresults?blocknumber={BlockNumber}&instanceid={QueryInstance}&json_resp={json_response}
getresults?blocknumber={BlockNumber}&instanceid={QueryInstance}
Example Request:
https://<servername>:<port>/PSIGW/RESTListeningConnector/<defaultlocal node>/QueryResults.v1/getresults?blocknumber=1&instanceid=acae80e8-2f99-11e3-95a9-8782b6a978ba
Response Message: QAS_GETQUERYRESULTS_RESP_MSG
Element Name |
Description |
---|---|
FILEURL |
Returns FILE URL. |
status |
If the output format is file, the return status will be either success orfailure. If the output format is non file the return status will be one of the following:
|
Example Response:
<?xml version="1.0"?>
<QAS_GETQUERYRESULTS_RESP_MSG xmlns="http://xmlns.oracle.com/Enterprise/
Tools/schemas/QAS_GETQUERYRESULTS_RESP_MSG.VERSION_2">
<query numrows="10" queryname="" xmlns="http://xmlns.oracle.com/
Enterprise/Tools/schemas/QAS_QUERYRESULTS_XMLP_RESP.VERSION_1">
<row rownumber="1">
<MESSAGE_SET_NBR>1</MESSAGE_SET_NBR>
<DESCR>
<![CDATA[PeopleTools Message Bar Items]]>
</DESCR>
</row>
<row rownumber="2">
<MESSAGE_SET_NBR>2</MESSAGE_SET_NBR>
<DESCR>
<![CDATA[PeopleCode]]>
</DESCR>
</row>
<row rownumber="3">
<MESSAGE_SET_NBR>3</MESSAGE_SET_NBR>
<DESCR>
<![CDATA[General Tools Messages]]>
</DESCR>
</row>
<row rownumber="4">
<MESSAGE_SET_NBR>4</MESSAGE_SET_NBR>
<DESCR>
<![CDATA[Help Processor]]>
</DESCR>
</row>
<row rownumber="5">
<MESSAGE_SET_NBR>5</MESSAGE_SET_NBR>
<DESCR>
<![CDATA[Help Text Manager]]>
</DESCR>
</row>
<row rownumber="6">
<MESSAGE_SET_NBR>6</MESSAGE_SET_NBR>
<DESCR>
<![CDATA[Import Definition Manager]]>
</DESCR>
</row>
<row rownumber="7">
<MESSAGE_SET_NBR>7</MESSAGE_SET_NBR>
<DESCR>
<![CDATA[Open Query API]]>
</DESCR>
</row>
<row rownumber="8">
<MESSAGE_SET_NBR>8</MESSAGE_SET_NBR>
<DESCR>
<![CDATA[PeopleCode Editor]]>
</DESCR>
</row>
<row rownumber="9">
<MESSAGE_SET_NBR>9</MESSAGE_SET_NBR>
<DESCR>
<![CDATA[Menu Definition Manager]]>
</DESCR>
</row>
<row rownumber="10">
<MESSAGE_SET_NBR>10</MESSAGE_SET_NBR>
<DESCR>
<![CDATA[Change Control]]>
</DESCR>
</row>
</query>
<QAS_QUERYRESULTS_STATUS_RESP xmlns="http://xmlns.oracle.com/Enterprise/
Tools/schemas/QAS_QUERYRESULTS_STATUS_RESP.VERSION_2">
<status>finalBlockRetrieved</status>
</QAS_QUERYRESULTS_STATUS_RESP>
</QAS_GETQUERYRESULTS_RESP_MSG>
Example Response using json_response=true:
Example Request following Query Poll Get Request to run a Query to HTML/FILE:
{"status": "success","data": {"fileurl": "http:\/\/myserver.example.com\/psreports\/Q8551093\/312\
/MESSAGES_FOR_MSGSET.html","status": "posted"}}