Skip to main content

Read Statement Result

GET 

/sql/v1/organizations/:organization_id/environments/:environment_id/statements/:name/results

General Availability

Read Statement Result.

Request​

Responses​

Statement Result.

Response Headers
    X-Request-Id

    The unique identifier for the API request.

OpenAPI definition (YAML)
paths:
  /sql/v1/organizations/{organization_id}/environments/{environment_id}/statements/{name}/results:
    get:
      x-lifecycle-stage: General Availability
      x-self-access: true
      x-request-access-name: SQL API v1
      operationId: getSqlv1StatementResult
      description: '[![General Availability](https://img.shields.io/badge/Lifecycle%20Stage-General%20Availability-%2345c6e8)](#section/Versioning/API-Lifecycle-Policy)


        Read Statement Result.'
      parameters:
      - in: path
        name: organization_id
        schema:
          type: string
          format: uuid
        required: true
        description: The unique identifier for the organization.
      - in: path
        name: environment_id
        required: true
        schema:
          type: string
        description: The unique identifier for the environment.
      - name: name
        in: path
        required: true
        schema:
          type: string
        description: The unique identifier for the statement.
      - name: page_token
        in: query
        required: false
        schema:
          type: string
          maxLength: 255
        description: It contains the field offset in the CollectSinkFunction protocol. On the first request,
          it should be unset. The offset is assumed to start at 0.
      tags:
      - Statement Results (sql/v1)
      security:
      - resource-api-key: []
      - global-api-key: []
      - external-access-token: []
      responses:
        '200':
          description: Statement Result.
          content:
            application/json:
              schema:
                allOf:
                - type: object
                  description: '`Statement Result` represents a resource used to model results of SQL
                    statements.

                    The API allows you to read your SQL statement result.'
                  required:
                  - api_version
                  - kind
                  - metadata
                  - data
                  properties:
                    api_version:
                      type: string
                      enum:
                      - sql/v1
                      description: APIVersion defines the schema version of this representation of a resource.
                      example: sql/v1
                      readOnly: true
                    kind:
                      type: string
                      description: Kind defines the object this REST resource represents.
                      enum:
                      - StatementResult
                      readOnly: true
                    metadata:
                      readOnly: true
                      allOf:
                      - type: object
                        description: ListMeta describes metadata that resource collections may have
                        properties:
                          self:
                            description: Self is a Uniform Resource Locator (URL) at which an object can
                              be addressed. This URL encodes the service location, API version, and other
                              particulars necessary to locate the resource at a point in time
                            type: string
                            example: https://flink.us-west1.aws.confluent.cloud/sql/v1/environments/env-123/statements
                          next:
                            description: A URL that can be followed to get the next batch of results.
                            type: string
                            example: https://flink.us-west1.aws.confluent.cloud/sql/v1/environments/env-abc123/statements?page_token=UvmDWOB1iwfAIBPj6EYb
                          created_at:
                            type: string
                            format: date-time
                            example: '2006-01-02T15:04:05-07:00'
                            readOnly: true
                            description: The date and time at which this object was created. It is represented
                              in RFC3339 format and is in UTC.
                        title: ResultListMeta
                    results:
                      readOnly: true
                      allOf:
                      - type: object
                        description: A results property that contains a data property that contains an
                          array of results.
                        properties:
                          data:
                            type: array
                            description: "A data property that contains an array of results. Each entry\
                              \ in the array is a separate result.\n\nThe value of `op` attribute (if\
                              \ present) represents the kind of change that a row can describe in a changelog:\n\
                              \n`0`: represents `INSERT` (`+I`), i.e. insertion operation;\n\n`1`: represents\
                              \ `UPDATE_BEFORE` (`-U`), i.e. update operation with the previous content\
                              \ of the updated row.\nThis kind should occur together with `UPDATE_AFTER`\
                              \ for modelling an update that needs to retract\nthe previous row first.\
                              \ It is useful in cases of a non-idempotent update, i.e., an update of a\
                              \ row that is not\nuniquely identifiable by a key;\n\n`2`: represents `UPDATE_AFTER`\
                              \ (`+U`), i.e. update operation with new content of the updated row;\nThis\
                              \ kind CAN occur together with `UPDATE_BEFORE` for modelling an update that\n\
                              needs to retract the previous row first or it describes an idempotent update,\
                              \ i.e., an\nupdate of a row that is uniquely identifiable by a key;\n\n\
                              `3`: represents `DELETE` (`-D`), i.e. deletion operation;\n\nDefaults to\
                              \ `0`.\n\n### Value encoding by column type\n\nThe schema gives each column's\
                              \ type, so the row carries only values. Scalars are JSON strings in\nSQL\
                              \ notation. A SQL `NULL` is a bare `null`.\n\n| Schema `type`          \
                              \                    | Payload example                  |\n|--------------------------------------------|----------------------------------|\n\
                              | `CHAR`, `VARCHAR`                          | `\"A string\"`          \
                              \           |\n| `BOOLEAN`                                  | `\"TRUE\"\
                              `                         |\n| `BINARY`, `VARBINARY`                   \
                              \   | `\"x'7f0203'\"`                    |\n| `TINYINT`, `SMALLINT`, `INTEGER`,\
                              \ `BIGINT` | `\"42\"`                           |\n| `FLOAT`, `DOUBLE` \
                              \                         | `\"1.1111112E7\"`                  |\n| `DECIMAL`\
                              \                                  | `\"12.123\"`                      \
                              \ |\n| `DATE`                                     | `\"2023-04-06\"`   \
                              \                |\n| `TIME_WITHOUT_TIME_ZONE`                   | `\"10:56:22.541\"\
                              `                 |\n| `TIMESTAMP_WITHOUT_TIME_ZONE`              | `\"\
                              2023-04-06 10:59:32.628\"`      |\n| `TIMESTAMP_WITH_LOCAL_TIME_ZONE`  \
                              \         | `\"2023-04-06 11:06:47.224\"`      |\n| `INTERVAL_YEAR_MONTH`\
                              \                      | `\"+2000-02\"`                     |\n| `INTERVAL_DAY_TIME`\
                              \                        | `\"+2 07:33:20.000\"`              |\n| `ARRAY`\
                              \                                    | `[\"1\", \"2\", \"3\", null]`   \
                              \       |\n| `MULTISET`                                 | `[[\"a\", \"2\"\
                              ], [\"b\", \"1\"]]`       |\n| `MAP`                                   \
                              \   | `[[\"Bob\", \"a\"], [\"Alice\", \"b\"]]` |\n| `ROW`, `STRUCTURED_TYPE`\
                              \                   | `[\"12\", \"a\"]`                    |\n| `VARIANT`\
                              \                                  | `[11, \"sensor-7\"]`              \
                              \ |\n\nTimestamps use a space separator, not `T`. `TIMESTAMP_WITH_LOCAL_TIME_ZONE`\
                              \ is rendered in the\nsession time zone and carries no offset.\n\n`ROW`\
                              \ is positional, since its field names are in the schema. `ARRAY` is a plain\
                              \ list. `MAP` is a\nlist of `[key, value]` pairs and `MULTISET` a list of\
                              \ `[element, count]` pairs, so keys travel as\ndata and may be `null`.\n\
                              \n```\nschema:  {\"type\": \"ROW\", \"fields\": [\n           {\"name\"\
                              : \"id\",    \"field_type\": {\"type\": \"INTEGER\"}},\n           {\"name\"\
                              : \"tags\",  \"field_type\": {\"type\": \"ARRAY\",\n                   \
                              \            \"element_type\": {\"type\": \"VARCHAR\"}}},\n           {\"\
                              name\": \"props\", \"field_type\": {\"type\": \"MAP\",\n               \
                              \                \"key_type\":   {\"type\": \"VARCHAR\"},\n            \
                              \                   \"value_type\": {\"type\": \"INTEGER\"}}}]}\n\npayload:\
                              \ [\"12\", [\"hot\", \"cold\"], [[\"a\", \"1\"], [\"b\", \"2\"]]]\n```\n\
                              \n### VARIANT values\n\nA `VARIANT` schema node carries no element types,\
                              \ so the types live in the value and differ per\nrow. Each node is a positional\
                              \ array starting with an integer type code, and the code's **sign**\ngives\
                              \ the node's shape:\n\n| Code  | Node shape                      | Meaning\
                              \                             |\n|-------|---------------------------------|-------------------------------------|\n\
                              | `> 0` | `[code, value]`                 | a value                    \
                              \         |\n| `0`   | `[0]`                           | NULL, carries nothing\
                              \               |\n| `< 0` | `[code, metadataHex, valueHex]` | not decodable,\
                              \ raw bytes attached   |\n\n`TIMESTAMP_LTZ` and `TIMESTAMP_LTZ_NS` are the\
                              \ one exception to the `> 0` shape, see below.\n\n| Code | Type     | Code\
                              \ | Type          | Code | Type             |\n|------|----------|------|---------------|------|------------------|\n\
                              | `-2` | INVALID  | `6`  | INT           | `14` | TIMESTAMP_LTZ    |\n|\
                              \ `-1` | UNKNOWN  | `7`  | BIGINT        | `15` | BYTES            |\n|\
                              \ `0`  | NULL     | `8`  | FLOAT         | `16` | TIME             |\n|\
                              \ `1`  | OBJECT   | `9`  | DOUBLE        | `17` | TIMESTAMP_NS     |\n|\
                              \ `2`  | ARRAY    | `10` | DECIMAL       | `18` | TIMESTAMP_LTZ_NS |\n|\
                              \ `3`  | BOOLEAN  | `11` | STRING        | `19` | UUID             |\n|\
                              \ `4`  | TINYINT  | `12` | DATE          |      |                  |\n|\
                              \ `5`  | SMALLINT | `13` | TIMESTAMP     |      |                  |\n\n\
                              Codes are stable: a new type gets the next free code, and existing codes\
                              \ are never renumbered.\nClients switch on the code, never on the node's\
                              \ length.\n\nScalars use the same encoding as the column type of the same\
                              \ name above. `TIME` has millisecond\nprecision (`\"09:14:02.117\"`). `TIMESTAMP`\
                              \ has six fractional digits, `TIMESTAMP_NS` nine. `UUID` is\nthe canonical\
                              \ 8-4-4-4-12 string. `OBJECT` is an array of `[key, node]` pairs and `ARRAY`\
                              \ an\narray of nodes.\n\n`TIMESTAMP_LTZ` (six fractional digits) and `TIMESTAMP_LTZ_NS`\
                              \ (nine) are a three-element node\n`[code, utcTimestamp, offset]`: the instant\
                              \ rendered in UTC, plus the session time zone's offset\nat that instant\
                              \ as `+HH:MM` or `-HH:MM`, never `Z`. The offset follows daylight saving,\
                              \ so local time is\n`utcTimestamp` shifted by `offset`. This differs from\
                              \ a `TIMESTAMP_WITH_LOCAL_TIME_ZONE` column,\nwhich is rendered in the session\
                              \ time zone without an offset.\n\n```\n[1, [\n  [\"device\",  [11, \"sensor-7\"\
                              ]],\n  [\"logged\",  [14, \"2026-07-28 09:14:02.117000\", \"+02:00\"]],\n\
                              \  [\"meta\",    [1, [[\"n\", [4, \"7\"]], [\"ok\", [3, \"TRUE\"]]]]],\n\
                              \  [\"price\",   [10, \"100.00\"]],\n  [\"seen_at\", [13, \"2026-07-28 09:14:02.117000\"\
                              ]],\n  [\"tags\",    [2, [[11, \"hot\"], [0]]]],\n  [\"weird\",   [-1, \"\
                              x'0102'\", \"x'7f2a'\"]]\n]]\n```\n"
                            items: {}
                            example:
                            - op: 0
                              row:
                              - '101'
                              - Jay
                              - - null
                                - abc
                              - - null
                                - '456'
                              - 1990-01-12 12:00.12
                              - - - null
                                  - Alice
                                - - '42'
                                  - Bob
                        title: sql.v1.StatementResultResults
                  readOnly: true
                  title: sql.v1.StatementResult
                - type: object
                  required:
                  - api_version
                  - kind
                  - metadata
                  - results
                  properties:
                    results:
                      type: object
                      required:
                      - data
          headers:
            X-Request-Id:
              schema:
                type: string
              description: The unique identifier for the API request.
        '400':
          description: Bad Request
          headers:
            X-Request-Id:
              schema:
                type: string
              description: The unique identifier for the API request.
          content:
            application/json:
              schema:
                type: object
                description: Provides information about problems encountered while performing an operation.
                required:
                - errors
                properties:
                  errors:
                    description: List of errors which caused this operation to fail
                    type: array
                    items:
                      type: object
                      description: Describes a particular error encountered while performing an operation.
                      properties:
                        id:
                          description: A unique identifier for this particular occurrence of the problem.
                          type: string
                          maxLength: 255
                        status:
                          description: The HTTP status code applicable to this problem, expressed as a
                            string value.
                          type: string
                        code:
                          description: An application-specific error code, expressed as a string value.
                          type: string
                        title:
                          description: A short, human-readable summary of the problem. It **SHOULD NOT**
                            change from occurrence to occurrence of the problem, except for purposes of
                            localization.
                          type: string
                        detail:
                          description: A human-readable explanation specific to this occurrence of the
                            problem.
                          type: string
                        source:
                          type: object
                          description: If this error was caused by a particular part of the API request,
                            the source will point to the query string parameter or request body property
                            that caused it.
                          properties:
                            pointer:
                              description: A JSON Pointer [RFC6901] to the associated entity in the request
                                document [e.g. "/spec" for a spec object, or "/spec/title" for a specific
                                field].
                              type: string
                            parameter:
                              description: A string indicating which query parameter caused the error.
                              type: string
                        error_code:
                          type: integer
                          format: int32
                        message:
                          type: string
                          nullable: true
                      additionalProperties: false
                      title: Error
                    uniqueItems: true
                title: Failure
              example:
                errors:
                - id: ed42afdc-f0d5-4c0d-b428-9fc6ed6e279d
                  status: '400'
                  code: invalid_filter
                  title: Invalid Filter
                  detail: The 'delorean' resource can't be filtered by 'num_doors'
                  source:
                    parameter: num_doors
        '401':
          x-summary: Unauthorized
          description: The request lacks valid authentication credentials for this resource.
          headers:
            X-Request-Id:
              schema:
                type: string
              description: The unique identifier for the API request.
            WWW-Authenticate:
              schema:
                type: string
              description: The unique identifier for the API request.
              example: Basic error="invalid_key", error_description="The API Key is invalid"
          content:
            application/json:
              schema:
                type: object
                description: Provides information about problems encountered while performing an operation.
                required:
                - errors
                properties:
                  errors:
                    description: List of errors which caused this operation to fail
                    type: array
                    items:
                      type: object
                      description: Describes a particular error encountered while performing an operation.
                      properties:
                        id:
                          description: A unique identifier for this particular occurrence of the problem.
                          type: string
                          maxLength: 255
                        status:
                          description: The HTTP status code applicable to this problem, expressed as a
                            string value.
                          type: string
                        code:
                          description: An application-specific error code, expressed as a string value.
                          type: string
                        title:
                          description: A short, human-readable summary of the problem. It **SHOULD NOT**
                            change from occurrence to occurrence of the problem, except for purposes of
                            localization.
                          type: string
                        detail:
                          description: A human-readable explanation specific to this occurrence of the
                            problem.
                          type: string
                        source:
                          type: object
                          description: If this error was caused by a particular part of the API request,
                            the source will point to the query string parameter or request body property
                            that caused it.
                          properties:
                            pointer:
                              description: A JSON Pointer [RFC6901] to the associated entity in the request
                                document [e.g. "/spec" for a spec object, or "/spec/title" for a specific
                                field].
                              type: string
                            parameter:
                              description: A string indicating which query parameter caused the error.
                              type: string
                        error_code:
                          type: integer
                          format: int32
                        message:
                          type: string
                          nullable: true
                      additionalProperties: false
                      title: Error
                    uniqueItems: true
                title: Failure
              example:
                errors:
                - id: ed42afdc-f0d5-4c0d-b428-9fc6ed6e279d
                  status: '401'
                  code: user_unauthenticated
                  title: Authentication Required
                  detail: Valid authentication credentials must be provided
        '403':
          x-summary: Forbidden
          description: The access credentials were considered insufficient to grant access
          headers:
            X-Request-Id:
              schema:
                type: string
              description: The unique identifier for the API request.
          content:
            application/json:
              schema:
                type: object
                description: Provides information about problems encountered while performing an operation.
                required:
                - errors
                properties:
                  errors:
                    description: List of errors which caused this operation to fail
                    type: array
                    items:
                      type: object
                      description: Describes a particular error encountered while performing an operation.
                      properties:
                        id:
                          description: A unique identifier for this particular occurrence of the problem.
                          type: string
                          maxLength: 255
                        status:
                          description: The HTTP status code applicable to this problem, expressed as a
                            string value.
                          type: string
                        code:
                          description: An application-specific error code, expressed as a string value.
                          type: string
                        title:
                          description: A short, human-readable summary of the problem. It **SHOULD NOT**
                            change from occurrence to occurrence of the problem, except for purposes of
                            localization.
                          type: string
                        detail:
                          description: A human-readable explanation specific to this occurrence of the
                            problem.
                          type: string
                        source:
                          type: object
                          description: If this error was caused by a particular part of the API request,
                            the source will point to the query string parameter or request body property
                            that caused it.
                          properties:
                            pointer:
                              description: A JSON Pointer [RFC6901] to the associated entity in the request
                                document [e.g. "/spec" for a spec object, or "/spec/title" for a specific
                                field].
                              type: string
                            parameter:
                              description: A string indicating which query parameter caused the error.
                              type: string
                        error_code:
                          type: integer
                          format: int32
                        message:
                          type: string
                          nullable: true
                      additionalProperties: false
                      title: Error
                    uniqueItems: true
                title: Failure
              example:
                errors:
                - id: ed42afdc-f0d5-4c0d-b428-9fc6ed6e279d
                  status: '403'
                  code: user_unauthorized
                  title: User Access Unauthorized
                  detail: The user 'mcfly' is not allowed to access the 'delorean' resource without the
                    'plutonium' role.
        '404':
          description: Not Found
          headers:
            X-Request-Id:
              schema:
                type: string
              description: The unique identifier for the API request.
          content:
            application/json:
              schema:
                type: object
                description: Provides information about problems encountered while performing an operation.
                required:
                - errors
                properties:
                  errors:
                    description: List of errors which caused this operation to fail
                    type: array
                    items:
                      type: object
                      description: Describes a particular error encountered while performing an operation.
                      properties:
                        id:
                          description: A unique identifier for this particular occurrence of the problem.
                          type: string
                          maxLength: 255
                        status:
                          description: The HTTP status code applicable to this problem, expressed as a
                            string value.
                          type: string
                        code:
                          description: An application-specific error code, expressed as a string value.
                          type: string
                        title:
                          description: A short, human-readable summary of the problem. It **SHOULD NOT**
                            change from occurrence to occurrence of the problem, except for purposes of
                            localization.
                          type: string
                        detail:
                          description: A human-readable explanation specific to this occurrence of the
                            problem.
                          type: string
                        source:
                          type: object
                          description: If this error was caused by a particular part of the API request,
                            the source will point to the query string parameter or request body property
                            that caused it.
                          properties:
                            pointer:
                              description: A JSON Pointer [RFC6901] to the associated entity in the request
                                document [e.g. "/spec" for a spec object, or "/spec/title" for a specific
                                field].
                              type: string
                            parameter:
                              description: A string indicating which query parameter caused the error.
                              type: string
                        error_code:
                          type: integer
                          format: int32
                        message:
                          type: string
                          nullable: true
                      additionalProperties: false
                      title: Error
                    uniqueItems: true
                title: Failure
              example:
                errors:
                - id: ed42afdc-f0d5-4c0d-b428-9fc6ed6e279d
                  status: '404'
                  title: Not Found
        '429':
          description: Rate Limit Exceeded
          headers:
            X-Request-Id:
              schema:
                type: string
              description: The unique identifier for the API request.
            X-RateLimit-Limit:
              schema:
                type: integer
              description: The maximum number of requests you're permitted to make per time period.
            X-RateLimit-Remaining:
              schema:
                type: integer
              description: The number of requests remaining in the current rate limit window.
            X-RateLimit-Reset:
              schema:
                type: integer
              description: "The relative time in seconds until the current rate-limit window resets. \
                \ \n  \n**Important:** This differs from Github and Twitter's same-named header which\
                \ uses UTC epoch seconds. We use relative time to avoid client/server time synchronization\
                \ issues."
            Retry-After:
              schema:
                type: integer
              description: The number of seconds to wait until the rate limit window resets. Only sent
                when the rate limit is reached.
        '500':
          description: Oops, something went wrong!
          headers:
            X-Request-Id:
              schema:
                type: string
              description: The unique identifier for the API request.
          content:
            application/json:
              schema:
                type: object
                description: Provides information about problems encountered while performing an operation.
                required:
                - errors
                properties:
                  errors:
                    description: List of errors which caused this operation to fail
                    type: array
                    items:
                      type: object
                      description: Describes a particular error encountered while performing an operation.
                      properties:
                        id:
                          description: A unique identifier for this particular occurrence of the problem.
                          type: string
                          maxLength: 255
                        status:
                          description: The HTTP status code applicable to this problem, expressed as a
                            string value.
                          type: string
                        code:
                          description: An application-specific error code, expressed as a string value.
                          type: string
                        title:
                          description: A short, human-readable summary of the problem. It **SHOULD NOT**
                            change from occurrence to occurrence of the problem, except for purposes of
                            localization.
                          type: string
                        detail:
                          description: A human-readable explanation specific to this occurrence of the
                            problem.
                          type: string
                        source:
                          type: object
                          description: If this error was caused by a particular part of the API request,
                            the source will point to the query string parameter or request body property
                            that caused it.
                          properties:
                            pointer:
                              description: A JSON Pointer [RFC6901] to the associated entity in the request
                                document [e.g. "/spec" for a spec object, or "/spec/title" for a specific
                                field].
                              type: string
                            parameter:
                              description: A string indicating which query parameter caused the error.
                              type: string
                        error_code:
                          type: integer
                          format: int32
                        message:
                          type: string
                          nullable: true
                      additionalProperties: false
                      title: Error
                    uniqueItems: true
                title: Failure
              example:
                errors:
                - id: ed42afdc-f0d5-4c0d-b428-9fc6ed6e279d
                  status: '500'
                  code: out_of_gas
                  title: DeLorean Out Of Gas
                  detail: The DeLorean has run out of gas, but Doc Brown will fill 'er up for you asap
      servers:
      - url: https://flink.region.provider.confluent.cloud
        description: Flink Compute Pool Endpoint