XMLViewService Service

Use the XMLViewService service to retrieve results from Oracle Analytics Presentation Services in XML format.

Enumeration and Method Name Description

XMLQueryOutputFormat Enumeration

Specifies a list of valid values.

cancelQuery() Method

Cancels the current query.

executeSQLQuery() Method

Runs a SQL query.

executeXMLQuery() Method

Runs an XML query.

fetchNext() Method

Returns the next page of data rows.

getPromptedFilters() Method

Returns a filter XML structure containing only the analysis' columns with a prompted filter.

XMLQueryOutputFormat Enumeration

The XMLQueryOutputFormat enumeration specifies a list of values for the executeSQLQuery() Method and executeXMLQuery() Method.

This enumeration specifies a list of valid values for the executeSQLQuery() Method and executeXMLQuery() Method. For example, you might want to return data rows and metadata, or data rows only.

Note:

Only one of the values in XMLQueryOutputFormat can be selected.

Values Description

String SAWRowsetData

Specifies that the query returns only data rows.

String SAWRowsetSchema

Specifies that the query returns only metadata.

String SAWRowsetSchemaAndData

Specifies that the query returns both metadata and data rows.

cancelQuery() Method

Use the cancelQuery() method to cancel a query and clean up resources associated with the query.

This method should only be used if the query row set is not scrolled to the last row in the data set returned.

Note:

If you use this method when the query row set is scrolled to the last row in the data set returned, query data is cleaned up during the last fetchNext method invocation.

Signature

void cancelQuery(String queryID, String sessionID);

Argument Description

String queryID

Specifies the unique ID of the query.

String sessionID

Specifies the unique ID of the session.

executeSQLQuery() Method

Use the executeSQLQuery() method to execute a SQL query and return the results of the query.

If the results returned exceed one page, you need to use the fetchNext() Method to return the next page of rows.

Signature

QueryResults executeSQLQuery(String sql, XMLQueryOutputFormat outputFormat, XMLQueryExecutionOptions executionOptions, String sessionID);

Argument Description

String sql

Specifies the string of SQL code to execute.

XMLQueryOutputFormat outputFormat

Specifies the output format (for more information, see XMLQueryExecutionOptions Structure).

XMLQueryExecutionOptions executionOptions

Specifies the query execution options (for more information, see XMLQueryExecutionOptions Structure).

String sessionID

Specifies the unique ID of the session.

Returns

Returns the results of the query as one or more rows of data in a QueryResults structure.

See QueryResults Structure.

executeXMLQuery() Method

Use the executeXMLQuery() method to execute an XML query and return the results of the query.

If the results returned exceed one page, you need to use the fetchNext() Method to return the next page of rows.

Signature

QueryResults executeXMLQuery(ReportRef report, XMLQueryOutputFormat outputFormat, XMLQueryExecutionOptions executionOptions, ReportParams reportParams, String sessionID);

Argument Description

ReportRef reportRef

Specifies the analysis definition, supplied in the ReportRef common structure.

XMLQueryOutputFormat outputFormat

Specifies the output format (for more information, see XMLQueryExecutionOptions Structure).

XMLQueryExecutionOptions executionOptions

Specifies the query execution options (for more information, see XMLQueryExecutionOptions Structure).

ReportParams reportParams

Optional. Specifies the filters or variables to apply to the analysis before execution, supplied in the ReportParams common structure. For information about the ReportParams structure, see ReportParams Structure.

String sessionID

Specifies the unique ID of the session.

Returns

Returns the results of the query as one or more rows of data in a QueryResults structure.

See QueryResults Structure.

fetchNext() Method

Use the fetchNext() method to return the next page of rows retrieved by a query.

The page returned might contain zero rows. If the finished flag is not set, the remaining rows might not be available immediately.

Signature

QueryResults fetchNext(String queryID, String sessionID);

Argument Description

String queryID

Specifies the unique ID of the query, which is returned in the QueryResults object.

String sessionID

Specifies the unique ID of the session.

Returns

Returns the next page of query results as one or more rows of data in a QueryResults structure.

See QueryResults Structure.

getPromptedFilters() Method

Use the getPromptedFilters() method to retrieve a saved analysis' prompted columns or the prompted columns from an analysis' XML definition.

Note that to create an analysis with a prompted column, you must assign the isPrompted operator to it.

Signature

List[] getPromptedFilters(ReportRef report, String sessionID);

Argument Description

ReportRef report

Specifies the analysis' reportPath or a reportXml (report definition).

String sessionID

Specifies the unique ID of the session.