> ## Documentation Index
> Fetch the complete documentation index at: https://docs.activeviam.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Execute a query on the database via GET method.

> Execute a query on the database, on a given table, via GET method. The query can be paginated using the parameters page and pageSize.



## OpenAPI

````yaml get /activeviam/pivot/rest/v9/database/data/tables/{tableName}
openapi: 3.0.0
info:
  title: Atoti REST services
  version: 6.1.18-SNAPSHOT
servers:
  - description: Generated server url
    url: http://localhost:9090
security: []
tags:
  - description: Implementation of the REST API controller for an ActivePivot database.
    name: Database REST API
  - description: >
      XML for Analysis (XMLA) endpoint for executing MDX queries and OLAP
      discovery operations.


      This endpoint implements the XMLA protocol which is used by:

      - Microsoft Excel and other OLAP clients

      - Custom BI tools that support XMLA connectivity


      The endpoint supports both text XML and binary XML formats for improved
      performance.
    name: XMLA API
  - description: Definition of REST API to query data from ActivePivot (V10).
    name: Query REST API (V10)
  - description: Definition of REST API to query data from ActivePivot (V9).
    name: Query REST API (V9)
  - description: Implementation of the REST Bulk API of the content server (version 8).
    name: Bulk REST API
  - description: Implementation of the REST API of the content server.
    name: Content Server REST API
  - description: Implementation of the REST API controller for an ActivePivot database.
    name: Database REST API v9
  - description: ' Definition of the REST service returning the list of services exposed by an application.'
    name: Version REST API
  - description: Rest Service providing the discovery information.
    name: Discovery REST API
  - description: API to access measures information.
    name: Diagnostics API
  - description: JSON Web Token (JWT) endpoint.
    name: JWT API
  - description: >
      Endpoints to retrieve and manage query history.


      **Note:** This API is experimental and may change in future versions
      without notice.
    name: Query History REST API (Experimental)
  - description: Description of REST API to configure an ActivePivot application.
    name: Configuration REST API
  - description: API to export the result of MDX queries
    name: Data Export
  - description: >
      GetAggregatesQuery (GAQ) REST API for executing OLAP queries.


      This API provides a programmatic way to execute GetAggregatesQuery
      operations

      against Atoti cubes. Results and updates are streamed in Apache Arrow
      format for efficient

      data transfer and processing.
    name: Continuous GAQ Query REST API (Experimental)
  - description: Endpoints for AI-based optimization of Atoti cubes
    name: AI Optimizer
  - description: >
      GetAggregatesQuery (GAQ) REST API for executing OLAP queries.


      This API provides a programmatic way to execute GetAggregatesQuery
      operations

      against Atoti cubes. Results are returned in Apache Arrow format for
      efficient

      data transfer and processing.


      **Note:** This API is experimental and may change in future versions
      without notice.
    name: GAQ Query REST API (Experimental)
  - description: Implementation of the REST Bulk API of the content server.
    name: Bulk REST API
paths:
  /activeviam/pivot/rest/v9/database/data/tables/{tableName}:
    get:
      tags:
        - Database REST API v9
      summary: Execute a query on the database via GET method.
      description: >-
        Execute a query on the database, on a given table, via GET method. The
        query can be paginated using the parameters page and pageSize.
      operationId: queryDatabaseGet
      parameters:
        - description: Desired table name.
          in: path
          name: tableName
          required: true
          schema:
            type: string
        - description: The branch on which to retrieve rows. Default is master branch.
          in: query
          name: branch
          required: false
          schema:
            type: string
        - description: The epoch on which to retrieve rows. Default is latest.
          in: query
          name: epoch
          required: false
          schema:
            default: -1
            format: int64
            type: integer
        - description: The maximum number of rows in the page. Default is 100.
          in: query
          name: pageSize
          required: false
          schema:
            default: 20
            format: int32
            type: integer
        - description: The page to return. First page (and default) is 1.
          in: query
          name: page
          required: false
          schema:
            default: 1
            format: int32
            type: integer
        - description: >-
            The fields (columns) of the rows to retrieve, separated by commas.
            If not specified, all the fields are returned.
          in: query
          name: fields
          required: false
          schema:
            items:
              type: string
            type: array
      responses:
        '200':
          content:
            application/json:
              examples:
                Success:
                  description: Success
                  externalValue: >-
                    https://docs.activeviam.com/products/atoti/server/6.1/rest/6.1.18/examples/database-v9/getQueryAnswer.json
              schema:
                $ref: '#/components/schemas/JsonDatabaseQueryResult'
          description: Query executed successfully.
components:
  schemas:
    JsonDatabaseQueryResult:
      properties:
        epoch:
          format: int64
          type: integer
        headers:
          items:
            $ref: '#/components/schemas/JsonTabularHeader'
          type: array
        pagination:
          $ref: '#/components/schemas/JsonPagination'
        rows:
          items:
            items:
              type: object
            type: array
          type: array
      type: object
    JsonTabularHeader:
      properties:
        caption:
          type: string
        name:
          type: string
        type:
          type: string
        visible:
          type: boolean
      type: object
    JsonPagination:
      properties:
        currentPage:
          format: int32
          type: integer
        nextPage:
          format: int32
          type: integer
        nextPageUrl:
          type: string
        previousPage:
          format: int32
          type: integer
        previousPageUrl:
          type: string
      type: object

````