ScyllaDB University Live | Free Virtual Training Event
Learn more
ScyllaDB Documentation Logo Documentation
  • Server
  • Cloud
  • Tools
    • ScyllaDB Manager
    • ScyllaDB Monitoring Stack
    • ScyllaDB Operator
  • Drivers
    • CQL Drivers
    • DynamoDB Drivers
  • Resources
    • ScyllaDB University
    • Community Forum
    • Tutorials
Download
ScyllaDB Docs Scylla C/C++ Driver API Documentation CassResult

CassResult¶

struct CassResult¶

The result of a query.

A result object is read-only and is thread-safe to read or iterate over concurrently.

Public Functions

void cass_result_free(const CassResult *result)¶

Frees a result instance.

This method invalidates all values, rows, and iterators that were derived from this result.

Parameters:

result – [in]

size_t cass_result_row_count(const CassResult *result)¶

Gets the number of rows for the specified result.

Parameters:

result – [in]

Returns:

The number of rows in the result.

size_t cass_result_column_count(const CassResult *result)¶

Gets the number of columns per row for the specified result.

Parameters:

result – [in]

Returns:

The number of columns per row in the result.

CassError cass_result_column_name(const CassResult *result, size_t index, const char **name, size_t *name_length)¶

Gets the column name at index for the specified result.

Parameters:
  • result – [in]

  • index – [in]

  • name – [out] The column name at the specified index.

  • name_length – [out]

Returns:

CASS_OK if successful, otherwise error occurred

CassValueType cass_result_column_type(const CassResult *result, size_t index)¶

Gets the column type at index for the specified result.

Parameters:
  • result – [in]

  • index – [in]

Returns:

The column type at the specified index. CASS_VALUE_TYPE_UNKNOWN is returned if the index is out of bounds.

const CassDataType *cass_result_column_data_type(const CassResult *result, size_t index)¶

Gets the column data type at index for the specified result.

Parameters:
  • result – [in]

  • index – [in]

Returns:

The column type at the specified index. NULL is returned if the index is out of bounds.

const CassRow *cass_result_first_row(const CassResult *result)¶

Gets the first row of the result.

Parameters:

result – [in]

Returns:

The first row of the result. NULL if there are no rows.

cass_bool_t cass_result_has_more_pages(const CassResult *result)¶

Returns true if there are more pages.

Requires Apache Cassandra: 2.0+

Parameters:

result – [in]

Returns:

cass_true if there are more pages

CassError cass_result_paging_state_token(const CassResult *result, const char **paging_state, size_t *paging_state_size)¶

Gets the raw paging state from the result. The paging state is bound to the lifetime of the result object. If paging state needs to live beyond the lifetime of the result object it must be copied.

Warning: The paging state should not be exposed to or come from untrusted environments. The paging state could be spoofed and potentially used to gain access to other data.

Requires Apache Cassandra: 2.0+

See also

cass_statement_set_paging_state_token()

Parameters:
  • result – [in]

  • paging_state – [out]

  • paging_state_size – [out]

Returns:

CASS_OK if successful, otherwise error occurred

CassIterator *cass_iterator_from_result(const CassResult *result)¶

Creates a new iterator for the specified result. This can be used to iterate over rows in the result.

See also

cass_iterator_free()

Parameters:

result – [in]

Returns:

A new iterator that must be freed.

Was this page helpful?

PREVIOUS
CassPrepared
NEXT
CassRetryPolicy
  • Create an issue
  • Edit this page

On this page

  • CassResult
    • CassResult
      • CassResult::cass_result_free()
      • CassResult::cass_result_row_count()
      • CassResult::cass_result_column_count()
      • CassResult::cass_result_column_name()
      • CassResult::cass_result_column_type()
      • CassResult::cass_result_column_data_type()
      • CassResult::cass_result_first_row()
      • CassResult::cass_result_has_more_pages()
      • CassResult::cass_result_paging_state_token()
      • CassResult::cass_iterator_from_result()
Scylla C/C++ Driver
  • master
    • master
  • C/C++ Driver for ScyllaDB
  • API Documentation
    • CassAggregateMeta
    • CassAuthenticator
    • CassAuthenticatorCallbacks
    • CassBatch
    • CassCluster
    • CassCollection
    • CassColumnMeta
    • CassCustomPayload
    • CassDataType
    • CassErrorResult
    • CassExecProfile
    • CassFunctionMeta
    • CassFuture
    • CassIndexMeta
    • CassInet
    • CassIterator
    • CassKeyspaceMeta
    • CassLogMessage
    • CassMaterializedViewMeta
    • CassMetrics
    • CassNode
    • CassPrepared
    • CassResult
    • CassRetryPolicy
    • CassRow
    • CassSchemaMeta
    • CassSession
    • CassSpeculativeExecutionMetrics
    • CassSsl
    • CassStatement
    • CassTableMeta
    • CassTimestampGen
    • CassTuple
    • CassUserType
    • CassUuid
    • CassUuidGen
    • CassValue
    • CassVersion
    • DseDateRange
    • DseDateRangeBound
    • DseLineString
    • DseLineStringIterator
    • DsePolygon
    • DsePolygonIterator
  • Features
    • Basics
      • Batches
      • Binding Parameters
      • Client-side timestamps
      • Consistency
      • Data Types
      • The date and time Types
      • Futures
      • Handling Results
      • Keyspaces
      • Prepared Statements
      • Schema Metadata
      • Tuples
      • User-Defined Types (UDTs)
      • UUIDs
    • Building
    • Client Configuration
    • Cloud
    • Configuration
      • Retry policies
    • Execution Profiles
    • FAQ
    • Installation
    • Logging
    • Metrics
    • Scylla Specific Features
    • Security
      • SSL
    • Testing
      • Cassandra Cluster Manager (CCM)
    • Tracing
  • DSE Features
    • Authentication
    • Geospatial types
Docs Tutorials University Contact Us About Us
© 2025, ScyllaDB. All rights reserved. | Terms of Service | Privacy Policy | ScyllaDB, and ScyllaDB Cloud, are registered trademarks of ScyllaDB, Inc.
Last updated on 28 April 2025.
Powered by Sphinx 7.4.7 & ScyllaDB Theme 1.8.6