struct CassStatement
A statement object is an executable query. It represents either a regular (adhoc) statement or a prepared statement. It maintains the queries’ parameter values along with query options (consistency level, paging state, etc.)
Note: Parameters for regular queries are not supported by the binary protocol version 1.
Functions
CassStatement *
cass_statement_new
( query, parameter_count )Creates a new query statement.
- Parameters:
Name Type Details in query The query is copied into the statement object; the memory pointed to by this parameter can be freed after this call.
in parameter_count The number of bound parameters.
- Returns:
Type Details CassStatement *
Returns a statement that must be freed.
- See Also:
CassStatement *
cass_statement_new_n
( query, query_length, parameter_count )Same as CassStatement::cass_statement_new
, but with lengths for string parameters.
- Parameters:
Name Type Details in query in query_length in parameter_count - Returns:
Type Details CassStatement *
- See Also:
CassError
cass_statement_reset_parameters
( statement, count )Clear and/or resize the statement’s parameters.
- Parameters:
Name Type Details in statement in count - Returns:
Type Details CassError
CASS_OK if successful, otherwise an error occurred.
void
cass_statement_free
( statement )Frees a statement instance. Statements can be immediately freed after being prepared, executed or added to a batch.
- Parameters:
Name Type Details in statement
CassError
cass_statement_add_key_index
( statement, index )Adds a key index specifier to this a statement. When using token-aware routing, this can be used to tell the driver which parameters within a non-prepared, parameterized statement are part of the partition key.
Use consecutive calls for composite partition keys.
This is not necessary for prepared statements, as the key parameters are determined in the metadata processed in the prepare phase.
- Parameters:
Name Type Details in statement in index - Returns:
Type Details CassError
CASS_OK if successful, otherwise an error occurred.
CassError
cass_statement_set_keyspace
( statement, keyspace )Sets the statement’s keyspace for use with token-aware routing.
This is not necessary for prepared statements, as the keyspace is determined in the metadata processed in the prepare phase.
- Parameters:
Name Type Details in statement in keyspace - Returns:
Type Details CassError
CASS_OK if successful, otherwise an error occurred.
CassError
cass_statement_set_keyspace_n
( statement, keyspace, keyspace_length )Same as CassStatement::cass_statement_set_keyspace
, but with lengths for string parameters.
- Parameters:
Name Type Details in statement in keyspace in keyspace_length - Returns:
Type Details CassError
- See Also:
CassError
cass_statement_set_consistency
( statement, consistency )Sets the statement’s consistency level.
Default: CASS_CONSISTENCY_LOCAL_ONE
- Parameters:
Name Type Details in statement in consistency - Returns:
Type Details CassError
CASS_OK if successful, otherwise an error occurred.
CassError
cass_statement_set_serial_consistency
( statement, serial_consistency )Sets the statement’s serial consistency level.
Requires Cassandra: 2.0+
Default: Not set
- Parameters:
Name Type Details in statement in serial_consistency - Returns:
Type Details CassError
CASS_OK if successful, otherwise an error occurred.
CassError
cass_statement_set_paging_size
( statement, page_size )Sets the statement’s page size.
Requires Cassandra: 2.0+
Default: -1 (Disabled)
- Parameters:
Name Type Details in statement in page_size - Returns:
Type Details CassError
CASS_OK if successful, otherwise an error occurred.
CassError
cass_statement_set_paging_state
( statement, result )Sets the statement’s paging state. This can be used to get the next page of data in a multi-page query.
Requires Cassandra: 2.0+
- Parameters:
Name Type Details in statement in result - Returns:
Type Details CassError
CASS_OK if successful, otherwise an error occurred.
CassError
cass_statement_set_paging_state_token
( statement, paging_state, paging_state_size )Sets the statement’s paging state. This can be used to get the next page of data in a multi-page query.
Requires Cassandra: 2.0+
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.
- Parameters:
Name Type Details in statement in paging_state in paging_state_size - Returns:
Type Details CassError
CASS_OK if successful, otherwise an error occurred.
- See Also:
CassError
cass_statement_set_timestamp
( statement, timestamp )Sets the statement’s timestamp.
Requires Cassandra: 2.1+
- Parameters:
Name Type Details in statement in timestamp - Returns:
Type Details CassError
CASS_OK if successful, otherwise an error occurred.
CassError
cass_statement_set_request_timeout
( statement, timeout_ms )Sets the statement’s timeout for waiting for a response from a node.
Default: Disabled (use the cluster-level request timeout)
- Parameters:
Name Type Details in statement in timeout_ms Request timeout in milliseconds. Use 0 for no timeout or CASS_UINT64_MAX to disable (to use the cluster-level request timeout).
- Returns:
Type Details CassError
CASS_OK if successful, otherwise an error occurred.
- See Also:
CassError
cass_statement_set_is_idempotent
( statement, is_idempotent )Sets whether the statement is idempotent. Idempotent statements are able to be automatically retried after timeouts/errors and can be speculatively executed.
- Parameters:
Name Type Details in statement in is_idempotent - Returns:
Type Details CassError
CASS_OK if successful, otherwise an error occurred.
- See Also:
CassError
cass_statement_set_retry_policy
( statement, retry_policy )Sets the statement’s retry policy.
- Parameters:
Name Type Details in statement in retry_policy - Returns:
Type Details CassError
CASS_OK if successful, otherwise an error occurred.
CassError
cass_statement_set_custom_payload
( statement, payload )Sets the statement’s custom payload.
Requires Cassandra: 2.2+
- Parameters:
Name Type Details in statement in payload - Returns:
Type Details CassError
CASS_OK if successful, otherwise an error occurred.
CassError
cass_statement_bind_null
( statement, index )Binds null to a query or bound statement at the specified index.
- Parameters:
Name Type Details in statement in index - Returns:
Type Details CassError
CASS_OK if successful, otherwise an error occurred.
CassError
cass_statement_bind_null_by_name
( statement, name )Binds a null to all the values with the specified name.
This can only be used with statements created by CassPrepared::cass_prepared_bind
when using Cassandra 2.0 or earlier.
- Parameters:
Name Type Details in statement in name - Returns:
Type Details CassError
CASS_OK if successful, otherwise an error occurred.
CassError
cass_statement_bind_null_by_name_n
( statement, name, name_length )Same as CassStatement::cass_statement_bind_null_by_name
, but with lengths for string parameters.
- Parameters:
Name Type Details in statement in name in name_length - Returns:
Type Details CassError
- See Also:
CassError
cass_statement_bind_int8
( statement, index, value )Binds a "tinyint" to a query or bound statement at the specified index.
Requires Cassandra: 2.2+
- Parameters:
Name Type Details in statement in index in value - Returns:
Type Details CassError
CASS_OK if successful, otherwise an error occurred.
CassError
cass_statement_bind_int8_by_name
( statement, name, value )Binds a "tinyint" to all the values with the specified name.
Requires Cassandra: 2.2+
- Parameters:
Name Type Details in statement in name in value - Returns:
Type Details CassError
CASS_OK if successful, otherwise an error occurred.
CassError
cass_statement_bind_int8_by_name_n
( statement, name, name_length, value )Same as CassStatement::cass_statement_bind_int8_by_name
, but with lengths for string parameters.
Requires Cassandra: 2.2+
- Parameters:
Name Type Details in statement in name in name_length in value - Returns:
Type Details CassError
- See Also:
CassError
cass_statement_bind_int16
( statement, index, value )Binds an "smallint" to a query or bound statement at the specified index.
Requires Cassandra: 2.2+
- Parameters:
Name Type Details in statement in index in value - Returns:
Type Details CassError
CASS_OK if successful, otherwise an error occurred.
CassError
cass_statement_bind_int16_by_name
( statement, name, value )Binds an "smallint" to all the values with the specified name.
Requires Cassandra: 2.2+
- Parameters:
Name Type Details in statement in name in value - Returns:
Type Details CassError
CASS_OK if successful, otherwise an error occurred.
CassError
cass_statement_bind_int16_by_name_n
( statement, name, name_length, value )Same as CassStatement::cass_statement_bind_int16_by_name
, but with lengths for string parameters.
Requires Cassandra: 2.2+
- Parameters:
Name Type Details in statement in name in name_length in value - Returns:
Type Details CassError
- See Also:
CassError
cass_statement_bind_int32
( statement, index, value )Binds an "int" to a query or bound statement at the specified index.
- Parameters:
Name Type Details in statement in index in value - Returns:
Type Details CassError
CASS_OK if successful, otherwise an error occurred.
CassError
cass_statement_bind_int32_by_name
( statement, name, value )Binds an "int" to all the values with the specified name.
This can only be used with statements created by CassPrepared::cass_prepared_bind
when using Cassandra 2.0 or earlier.
- Parameters:
Name Type Details in statement in name in value - Returns:
Type Details CassError
CASS_OK if successful, otherwise an error occurred.
CassError
cass_statement_bind_int32_by_name_n
( statement, name, name_length, value )Same as CassStatement::cass_statement_bind_int32_by_name
, but with lengths for string parameters.
- Parameters:
Name Type Details in statement in name in name_length in value - Returns:
Type Details CassError
- See Also:
CassError
cass_statement_bind_uint32
( statement, index, value )Binds a "date" to a query or bound statement at the specified index.
Requires Cassandra: 2.2+
- Parameters:
Name Type Details in statement in index in value - Returns:
Type Details CassError
CASS_OK if successful, otherwise an error occurred.
CassError
cass_statement_bind_uint32_by_name
( statement, name, value )Binds a "date" to all the values with the specified name.
Requires Cassandra: 2.2+
- Parameters:
Name Type Details in statement in name in value - Returns:
Type Details CassError
CASS_OK if successful, otherwise an error occurred.
CassError
cass_statement_bind_uint32_by_name_n
( statement, name, name_length, value )Same as CassStatement::cass_statement_bind_uint32_by_name
, but with lengths for string parameters.
Requires Cassandra: 2.2+
- Parameters:
Name Type Details in statement in name in name_length in value - Returns:
Type Details CassError
- See Also:
CassError
cass_statement_bind_int64
( statement, index, value )Binds a "bigint", "counter", "timestamp" or "time" to a query or bound statement at the specified index.
- Parameters:
Name Type Details in statement in index in value - Returns:
Type Details CassError
CASS_OK if successful, otherwise an error occurred.
CassError
cass_statement_bind_int64_by_name
( statement, name, value )Binds a "bigint", "counter", "timestamp" or "time" to all values with the specified name.
This can only be used with statements created by CassPrepared::cass_prepared_bind
when using Cassandra 2.0 or earlier.
- Parameters:
Name Type Details in statement in name in value - Returns:
Type Details CassError
CASS_OK if successful, otherwise an error occurred.
CassError
cass_statement_bind_int64_by_name_n
( statement, name, name_length, value )Same as CassStatement::cass_statement_bind_int64_by_name
, but with lengths for string parameters.
- Parameters:
Name Type Details in statement in name in name_length in value - Returns:
Type Details CassError
same as cass_statement_bind_int64_by_name(0
- See Also:
CassError
cass_statement_bind_float
( statement, index, value )Binds a "float" to a query or bound statement at the specified index.
- Parameters:
Name Type Details in statement in index in value - Returns:
Type Details CassError
CASS_OK if successful, otherwise an error occurred.
CassError
cass_statement_bind_float_by_name
( statement, name, value )Binds a "float" to all the values with the specified name.
This can only be used with statements created by CassPrepared::cass_prepared_bind
when using Cassandra 2.0 or earlier.
- Parameters:
Name Type Details in statement in name in value - Returns:
Type Details CassError
CASS_OK if successful, otherwise an error occurred.
CassError
cass_statement_bind_float_by_name_n
( statement, name, name_length, value )Same as CassStatement::cass_statement_bind_float_by_name
, but with lengths for string parameters.
- Parameters:
Name Type Details in statement in name in name_length in value - Returns:
Type Details CassError
- See Also:
CassError
cass_statement_bind_double
( statement, index, value )Binds a "double" to a query or bound statement at the specified index.
- Parameters:
Name Type Details in statement in index in value - Returns:
Type Details CassError
CASS_OK if successful, otherwise an error occurred.
CassError
cass_statement_bind_double_by_name
( statement, name, value )Binds a "double" to all the values with the specified name.
This can only be used with statements created by CassPrepared::cass_prepared_bind
when using Cassandra 2.0 or earlier.
- Parameters:
Name Type Details in statement in name in value - Returns:
Type Details CassError
CASS_OK if successful, otherwise an error occurred.
CassError
cass_statement_bind_double_by_name_n
( statement, name, name_length, value )Same as CassStatement::cass_statement_bind_double_by_name
, but with lengths for string parameters.
- Parameters:
Name Type Details in statement in name in name_length in value - Returns:
Type Details CassError
- See Also:
CassError
cass_statement_bind_bool
( statement, index, value )Binds a "boolean" to a query or bound statement at the specified index.
- Parameters:
Name Type Details in statement in index in value - Returns:
Type Details CassError
CASS_OK if successful, otherwise an error occurred.
CassError
cass_statement_bind_bool_by_name
( statement, name, value )Binds a "boolean" to all the values with the specified name.
This can only be used with statements created by CassPrepared::cass_prepared_bind
when using Cassandra 2.0 or earlier.
- Parameters:
Name Type Details in statement in name in value - Returns:
Type Details CassError
CASS_OK if successful, otherwise an error occurred.
CassError
cass_statement_bind_bool_by_name_n
( statement, name, name_length, value )Same as CassStatement::cass_statement_bind_bool_by_name
, but with lengths for string parameters.
- Parameters:
Name Type Details in statement in name in name_length in value - Returns:
Type Details CassError
- See Also:
CassError
cass_statement_bind_string
( statement, index, value )Binds an "ascii", "text" or "varchar" to a query or bound statement at the specified index.
- Parameters:
Name Type Details in statement in index in value The value is copied into the statement object; the memory pointed to by this parameter can be freed after this call.
- Returns:
Type Details CassError
CASS_OK if successful, otherwise an error occurred.
CassError
cass_statement_bind_string_n
( statement, index, value, value_length )Same as CassStatement::cass_statement_bind_string
, but with lengths for string parameters.
- Parameters:
Name Type Details in statement in index in value in value_length - Returns:
Type Details CassError
- See Also:
CassError
cass_statement_bind_string_by_name
( statement, name, value )Binds an "ascii", "text" or "varchar" to all the values with the specified name.
This can only be used with statements created by CassPrepared::cass_prepared_bind
when using Cassandra 2.0 or earlier.
- Parameters:
Name Type Details in statement in name in value The value is copied into the statement object; the memory pointed to by this parameter can be freed after this call.
- Returns:
Type Details CassError
CASS_OK if successful, otherwise an error occurred.
CassError
cass_statement_bind_string_by_name_n
( statement, name, name_length, value, value_length )Same as CassStatement::cass_statement_bind_string_by_name
, but with lengths for string parameters.
- Parameters:
Name Type Details in statement in name in name_length in value in value_length - Returns:
Type Details CassError
- See Also:
CassError
cass_statement_bind_bytes
( statement, index, value, value_size )Binds a "blob", "varint" or "custom" to a query or bound statement at the specified index.
- Parameters:
Name Type Details in statement in index in value The value is copied into the statement object; the memory pointed to by this parameter can be freed after this call.
in value_size - Returns:
Type Details CassError
CASS_OK if successful, otherwise an error occurred.
CassError
cass_statement_bind_bytes_by_name
( statement, name, value, value_size )Binds a "blob", "varint" or "custom" to all the values with the specified name.
This can only be used with statements created by CassPrepared::cass_prepared_bind
when using Cassandra 2.0 or earlier.
- Parameters:
Name Type Details in statement in name in value The value is copied into the statement object; the memory pointed to by this parameter can be freed after this call.
in value_size - Returns:
Type Details CassError
CASS_OK if successful, otherwise an error occurred.
CassError
cass_statement_bind_bytes_by_name_n
( statement, name, name_length, value, value_size )Same as CassStatement::cass_statement_bind_bytes_by_name
, but with lengths for string parameters.
- Parameters:
Name Type Details in statement in name in name_length in value in value_size - Returns:
Type Details CassError
- See Also:
CassError
cass_statement_bind_custom
( statement, index, class_name, value, value_size )Binds a "custom" to a query or bound statement at the specified index.
- Parameters:
Name Type Details in statement in index in class_name in value The value is copied into the statement object; the memory pointed to by this parameter can be freed after this call.
in value_size - Returns:
Type Details CassError
CASS_OK if successful, otherwise an error occurred.
CassError
cass_statement_bind_custom_n
( statement, index, class_name, class_name_length, value, value_size )Same as CassStatement::cass_statement_bind_custom
, but with lengths for string parameters.
- Parameters:
Name Type Details in statement in index in class_name in class_name_length in value The value is copied into the statement object; the memory pointed to by this parameter can be freed after this call.
in value_size - Returns:
Type Details CassError
CASS_OK if successful, otherwise an error occurred.
CassError
cass_statement_bind_custom_by_name
( statement, name, class_name, value, value_size )Binds a "custom" to all the values with the specified name.
This can only be used with statements created by CassPrepared::cass_prepared_bind
when using Cassandra 2.0 or earlier.
- Parameters:
Name Type Details in statement in name in class_name in value The value is copied into the statement object; the memory pointed to by this parameter can be freed after this call.
in value_size - Returns:
Type Details CassError
CASS_OK if successful, otherwise an error occurred.
CassError
cass_statement_bind_custom_by_name_n
( statement, name, name_length, class_name, class_name_length, value, value_size )Same as CassStatement::cass_statement_bind_custom_by_name
, but with lengths for string parameters.
- Parameters:
Name Type Details in statement in name in name_length in class_name in class_name_length in value in value_size - Returns:
Type Details CassError
- See Also:
CassError
cass_statement_bind_uuid
( statement, index, value )Binds a "uuid" or "timeuuid" to a query or bound statement at the specified index.
- Parameters:
Name Type Details in statement in index in value - Returns:
Type Details CassError
CASS_OK if successful, otherwise an error occurred.
CassError
cass_statement_bind_uuid_by_name
( statement, name, value )Binds a "uuid" or "timeuuid" to all the values with the specified name.
This can only be used with statements created by CassPrepared::cass_prepared_bind
when using Cassandra 2.0 or earlier.
- Parameters:
Name Type Details in statement in name in value - Returns:
Type Details CassError
CASS_OK if successful, otherwise an error occurred.
CassError
cass_statement_bind_uuid_by_name_n
( statement, name, name_length, value )Same as CassStatement::cass_statement_bind_uuid_by_name
, but with lengths for string parameters.
- Parameters:
Name Type Details in statement in name in name_length in value - Returns:
Type Details CassError
- See Also:
CassError
cass_statement_bind_inet
( statement, index, value )Binds an "inet" to a query or bound statement at the specified index.
- Parameters:
Name Type Details in statement in index in value - Returns:
Type Details CassError
CASS_OK if successful, otherwise an error occurred.
CassError
cass_statement_bind_inet_by_name
( statement, name, value )Binds an "inet" to all the values with the specified name.
This can only be used with statements created by CassPrepared::cass_prepared_bind
when using Cassandra 2.0 or earlier.
- Parameters:
Name Type Details in statement in name in value - Returns:
Type Details CassError
CASS_OK if successful, otherwise an error occurred.
CassError
cass_statement_bind_inet_by_name_n
( statement, name, name_length, value )Same as CassStatement::cass_statement_bind_inet_by_name
, but with lengths for string parameters.
- Parameters:
Name Type Details in statement in name in name_length in value - Returns:
Type Details CassError
- See Also:
CassError
cass_statement_bind_decimal
( statement, index, varint, varint_size, scale )Bind a "decimal" to a query or bound statement at the specified index.
- Parameters:
Name Type Details in statement in index in varint The value is copied into the statement object; the memory pointed to by this parameter can be freed after this call.
in varint_size in scale - Returns:
Type Details CassError
CASS_OK if successful, otherwise an error occurred.
CassError
cass_statement_bind_decimal_by_name
( statement, name, varint, varint_size, scale )Binds a "decimal" to all the values with the specified name.
This can only be used with statements created by CassPrepared::cass_prepared_bind
when using Cassandra 2.0 or earlier.
- Parameters:
Name Type Details in statement in name in varint The value is copied into the statement object; the memory pointed to by this parameter can be freed after this call.
in varint_size in scale - Returns:
Type Details CassError
CASS_OK if successful, otherwise an error occurred.
CassError
cass_statement_bind_decimal_by_name_n
( statement, name, name_length, varint, varint_size, scale )Same as CassStatement::cass_statement_bind_decimal_by_name
, but with lengths for string parameters.
- Parameters:
Name Type Details in statement in name in name_length in varint in varint_size in scale - Returns:
Type Details CassError
- See Also:
CassError
cass_statement_bind_duration
( statement, index, months, days, nanos )Binds a "duration" to a query or bound statement at the specified index.
Requires Cassandra: 3.10+
- Parameters:
Name Type Details in statement in index in months in days in nanos - Returns:
Type Details CassError
CASS_OK if successful, otherwise an error occurred.
CassError
cass_statement_bind_duration_by_name
( statement, name, months, days, nanos )Binds a "duration" to all the values with the specified name.
Requires Cassandra: 3.10+
- Parameters:
Name Type Details in statement in name in months in days in nanos - Returns:
Type Details CassError
CASS_OK if successful, otherwise an error occurred.
CassError
cass_statement_bind_duration_by_name_n
( statement, name, name_length, months, days, nanos )Same as CassStatement::cass_statement_bind_duration_by_name
, but with lengths for string parameters.
Requires Cassandra: 3.10+
- Parameters:
Name Type Details in statement in name in name_length in months in days in nanos - Returns:
Type Details CassError
- See Also:
CassError
cass_statement_bind_collection
( statement, index, collection )Bind a "list", "map" or "set" to a query or bound statement at the specified index.
- Parameters:
Name Type Details in statement in index in collection The collection can be freed after this call.
- Returns:
Type Details CassError
CASS_OK if successful, otherwise an error occurred.
CassError
cass_statement_bind_collection_by_name
( statement, name, collection )Bind a "list", "map" or "set" to all the values with the specified name.
This can only be used with statements created by CassPrepared::cass_prepared_bind
when using Cassandra 2.0 or earlier.
- Parameters:
Name Type Details in statement in name in collection The collection can be freed after this call.
- Returns:
Type Details CassError
CASS_OK if successful, otherwise an error occurred.
CassError
cass_statement_bind_collection_by_name_n
( statement, name, name_length, collection )Same as CassStatement::cass_statement_bind_collection_by_name
, but with lengths for string parameters.
- Parameters:
Name Type Details in statement in name in name_length in collection - Returns:
Type Details CassError
same as
CassStatement::cass_statement_bind_collection_by_name
- See Also:
CassError
cass_statement_bind_tuple
( statement, index, tuple )Bind a "tuple" to a query or bound statement at the specified index.
Requires Cassandra: 2.1+
- Parameters:
Name Type Details in statement in index in tuple The tuple can be freed after this call.
- Returns:
Type Details CassError
CASS_OK if successful, otherwise an error occurred.
CassError
cass_statement_bind_tuple_by_name
( statement, name, tuple )Bind a "tuple" to all the values with the specified name.
Requires Cassandra: 2.1+
- Parameters:
Name Type Details in statement in name in tuple The tuple can be freed after this call.
- Returns:
Type Details CassError
CASS_OK if successful, otherwise an error occurred.
CassError
cass_statement_bind_tuple_by_name_n
( statement, name, name_length, tuple )Same as CassStatement::cass_statement_bind_tuple_by_name
, but with lengths for string parameters.
Requires Cassandra: 2.1+
- Parameters:
Name Type Details in statement in name in name_length in tuple - Returns:
Type Details CassError
- See Also:
CassError
cass_statement_bind_user_type
( statement, index, user_type )Bind a user defined type to a query or bound statement at the specified index.
Requires Cassandra: 2.1+
- Parameters:
Name Type Details in statement in index in user_type The user type can be freed after this call.
- Returns:
Type Details CassError
CASS_OK if successful, otherwise an error occurred.
CassError
cass_statement_bind_user_type_by_name
( statement, name, user_type )Bind a user defined type to a query or bound statement with the specified name.
Requires Cassandra: 2.1+
- Parameters:
Name Type Details in statement in name in user_type The user type can be freed after this call.
- Returns:
Type Details CassError
CASS_OK if successful, otherwise an error occurred.
CassError
cass_statement_bind_user_type_by_name_n
( statement, name, name_length, user_type )Same as CassStatement::cass_statement_bind_user_type_by_name
, but with lengths for string parameters.
Requires Cassandra: 2.1+
- Parameters:
Name Type Details in statement in name in name_length in user_type - Returns:
Type Details CassError
same as
CassStatement::cass_statement_bind_user_type_by_name
- See Also: