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:
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_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.
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.
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.
- 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.
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.
- Parameters:
Name Type Details in statement in timestamp - Returns:
Type Details CassError
CASS_OK if successful, otherwise an error occurred.
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_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_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_int64
( statement, index, value )Binds a "bigint", "counter" or "timestamp" 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
( 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_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_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_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_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_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_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_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_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_tuple
( statement, index, tuple )Bind a "tuple" to a query or bound statement at the specified index.
- 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_user_type
( statement, index, user_type )Bind a user defined type to a query or bound statement at the specified index.
- 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_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
.
- 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_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
.
- 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_int64_by_name
( statement, name, value )Binds a "bigint", "counter" or "timestamp" to all values with the specified name.
This can only be used with statements created by CassPrepared::cass_prepared_bind
.
- 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_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
.
- 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_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
.
- 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_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
.
- 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_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
.
- 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_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
.
- 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_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
.
- 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_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
.
- 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_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
.
- 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_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
.
- 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_by_name
( statement, name, tuple )Bind a "tuple" to all the values with the specified name.
This can only be used with statements created by CassPrepared::cass_prepared_bind
.
- 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.
- 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_by_name
( statement, name, user_type )Bind a user defined type to a query or bound statement with the specified name.
- 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.
- 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: