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
CassError
cass_statement_bind_dse_point
(CassStatement *
statement, size_t
index, cass_double_t
x, cass_double_t
y )
Binds point to a query or bound statement at the specified index.
CassError
cass_statement_bind_dse_point_by_name
(CassStatement *
statement, const char *
name, cass_double_t
x, cass_double_t
y )
Binds a point to all the values with the specified name.
CassError
cass_statement_bind_dse_point_by_name_n
(CassStatement *
statement, const char *
name, size_t
name_length, cass_double_t
x, cass_double_t
y )
Same as CassStatement::cass_statement_bind_dse_point_by_name
, but with lengths for string parameters.
CassError
cass_statement_bind_dse_line_string
(CassStatement *
statement, size_t
index, const DseLineString *
line_string )
Binds line string to a query or bound statement at the specified index.
CassError
cass_statement_bind_dse_line_string_by_name
(CassStatement *
statement, const char *
name, const DseLineString *
line_string )
Binds a line string to all the values with the specified name.
CassError
cass_statement_bind_dse_line_string_by_name_n
(CassStatement *
statement, const char *
name, size_t
name_length, const DseLineString *
line_string )
Same as CassStatement::cass_statement_bind_dse_line_string_by_name
, but with lengths for string parameters.
CassError
cass_statement_bind_dse_polygon
(CassStatement *
statement, size_t
index, const DsePolygon *
polygon )
Binds polygon to a query or bound statement at the specified index.
CassError
cass_statement_bind_dse_polygon_by_name
(CassStatement *
statement, const char *
name, const DsePolygon *
polygon )
Binds a polygon to all the values with the specified name.
CassError
cass_statement_bind_dse_polygon_by_name_n
(CassStatement *
statement, const char *
name, size_t
name_length, const DsePolygon *
polygon )
Same as CassStatement::cass_statement_bind_dse_polygon_by_name
, but with lengths for string parameters.
CassError
cass_statement_bind_dse_date_range
(CassStatement *
statement, size_t
index, const DseDateRange *
range )
Binds a date-range to a query or bound statement at the specified index.
CassError
cass_statement_bind_dse_date_range_by_name
(CassStatement *
statement, const char *
name, const DseDateRange *
range )
Binds a date-range to all the values with the specified name.
CassError
cass_statement_bind_dse_date_range_by_name_n
(CassStatement *
statement, const char *
name, size_t
name_length, const DseDateRange *
range )
Same as CassStatement::cass_statement_bind_dse_date_range_by_name
, but with lengths for string parameters.
Sets the name of the user to execute the statement as.
CassError
cass_statement_set_execute_as_n
(CassStatement *
statement, const char *
name, size_t
name_length )
Same as CassStatement::cass_statement_set_execute_as
, but with lengths for string parameters.
Creates a new query statement.
CassStatement *
cass_statement_new_n
(const char *
query, size_t
query_length, size_t
parameter_count )
Same as CassStatement::cass_statement_new
, but with lengths for string parameters.
Clear and/or resize the statement’s parameters.
Frees a statement instance. Statements can be immediately freed after being prepared, executed or added to a batch.
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.
Sets the statement’s keyspace. This is used for token-aware routing and when using protocol v5/DSEv2 or greater it also overrides the session’s current keyspace for the statement.
This is not necessary and will not work for bound statements, as the keyspace is determined by the prepared statement metadata.
CassError
cass_statement_set_keyspace_n
(CassStatement *
statement, const char *
keyspace, size_t
keyspace_length )
Same as CassStatement::cass_statement_set_keyspace
, but with lengths for string parameters.
Sets the statement’s consistency level.
Default: CASS_CONSISTENCY_LOCAL_ONE
CassError
cass_statement_set_serial_consistency
(CassStatement *
statement, CassConsistency
serial_consistency )
Sets the statement’s serial consistency level.
Requires Cassandra: 2.0+
Default: Not set
Sets the statement’s page size.
Requires Cassandra: 2.0+
Default: -1 (Disabled)
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+
CassError
cass_statement_set_paging_state_token
(CassStatement *
statement, const char *
paging_state, size_t
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.
Sets the statement’s timestamp.
Requires Cassandra: 2.1+
CassError
cass_statement_set_request_timeout
(CassStatement *
statement, cass_uint64_t
timeout_ms )
Sets the statement’s timeout for waiting for a response from a node.
Default: Disabled (use the cluster-level request timeout)
Sets whether the statement is idempotent. Idempotent statements are able to be automatically retried after timeouts/errors and can be speculatively executed.
CassError
cass_statement_set_retry_policy
(CassStatement *
statement, CassRetryPolicy *
retry_policy )
Sets the statement’s retry policy.
CassError
cass_statement_set_custom_payload
(CassStatement *
statement, const CassCustomPayload *
payload )
Sets the statement’s custom payload.
Requires Cassandra: 2.2+
Binds null to a query or bound statement at the specified index.
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.
CassError
cass_statement_bind_null_by_name_n
(CassStatement *
statement, const char *
name, size_t
name_length )
Same as CassStatement::cass_statement_bind_null_by_name
, but with lengths for string parameters.
Binds a “tinyint” to a query or bound statement at the specified index.
Requires Cassandra: 2.2+
CassError
cass_statement_bind_int8_by_name
(CassStatement *
statement, const char *
name, cass_int8_t
value )
Binds a “tinyint” to all the values with the specified name.
Requires Cassandra: 2.2+
CassError
cass_statement_bind_int8_by_name_n
(CassStatement *
statement, const char *
name, size_t
name_length, cass_int8_t
value )
Same as CassStatement::cass_statement_bind_int8_by_name
, but with lengths for string parameters.
Requires Cassandra: 2.2+
Binds an “smallint” to a query or bound statement at the specified index.
Requires Cassandra: 2.2+
CassError
cass_statement_bind_int16_by_name
(CassStatement *
statement, const char *
name, cass_int16_t
value )
Binds an “smallint” to all the values with the specified name.
Requires Cassandra: 2.2+
CassError
cass_statement_bind_int16_by_name_n
(CassStatement *
statement, const char *
name, size_t
name_length, cass_int16_t
value )
Same as CassStatement::cass_statement_bind_int16_by_name
, but with lengths for string parameters.
Requires Cassandra: 2.2+
Binds an “int” to a query or bound statement at the specified index.
CassError
cass_statement_bind_int32_by_name
(CassStatement *
statement, const char *
name, cass_int32_t
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.
CassError
cass_statement_bind_int32_by_name_n
(CassStatement *
statement, const char *
name, size_t
name_length, cass_int32_t
value )
Same as CassStatement::cass_statement_bind_int32_by_name
, but with lengths for string parameters.
CassError
cass_statement_bind_uint32
(CassStatement *
statement, size_t
index, cass_uint32_t
value )
Binds a “date” to a query or bound statement at the specified index.
Requires Cassandra: 2.2+
CassError
cass_statement_bind_uint32_by_name
(CassStatement *
statement, const char *
name, cass_uint32_t
value )
Binds a “date” to all the values with the specified name.
Requires Cassandra: 2.2+
CassError
cass_statement_bind_uint32_by_name_n
(CassStatement *
statement, const char *
name, size_t
name_length, cass_uint32_t
value )
Same as CassStatement::cass_statement_bind_uint32_by_name
, but with lengths for string parameters.
Requires Cassandra: 2.2+
Binds a “bigint”, “counter”, “timestamp” or “time” to a query or bound statement at the specified index.
CassError
cass_statement_bind_int64_by_name
(CassStatement *
statement, const char *
name, cass_int64_t
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.
CassError
cass_statement_bind_int64_by_name_n
(CassStatement *
statement, const char *
name, size_t
name_length, cass_int64_t
value )
Same as CassStatement::cass_statement_bind_int64_by_name
, but with lengths for string parameters.
Binds a “float” to a query or bound statement at the specified index.
CassError
cass_statement_bind_float_by_name
(CassStatement *
statement, const char *
name, cass_float_t
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.
CassError
cass_statement_bind_float_by_name_n
(CassStatement *
statement, const char *
name, size_t
name_length, cass_float_t
value )
Same as CassStatement::cass_statement_bind_float_by_name
, but with lengths for string parameters.
CassError
cass_statement_bind_double
(CassStatement *
statement, size_t
index, cass_double_t
value )
Binds a “double” to a query or bound statement at the specified index.
CassError
cass_statement_bind_double_by_name
(CassStatement *
statement, const char *
name, cass_double_t
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.
CassError
cass_statement_bind_double_by_name_n
(CassStatement *
statement, const char *
name, size_t
name_length, cass_double_t
value )
Same as CassStatement::cass_statement_bind_double_by_name
, but with lengths for string parameters.
Binds a “boolean” to a query or bound statement at the specified index.
CassError
cass_statement_bind_bool_by_name
(CassStatement *
statement, const char *
name, cass_bool_t
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.
CassError
cass_statement_bind_bool_by_name_n
(CassStatement *
statement, const char *
name, size_t
name_length, cass_bool_t
value )
Same as CassStatement::cass_statement_bind_bool_by_name
, but with lengths for string parameters.
CassError
cass_statement_bind_string
(CassStatement *
statement, size_t
index, const char *
value )
Binds an “ascii”, “text” or “varchar” to a query or bound statement at the specified index.
CassError
cass_statement_bind_string_n
(CassStatement *
statement, size_t
index, const char *
value, size_t
value_length )
Same as CassStatement::cass_statement_bind_string
, but with lengths for string parameters.
CassError
cass_statement_bind_string_by_name
(CassStatement *
statement, const char *
name, const char *
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.
CassError
cass_statement_bind_string_by_name_n
(CassStatement *
statement, const char *
name, size_t
name_length, const char *
value, size_t
value_length )
Same as CassStatement::cass_statement_bind_string_by_name
, but with lengths for string parameters.
CassError
cass_statement_bind_bytes
(CassStatement *
statement, size_t
index, const cass_byte_t *
value, size_t
value_size )
Binds a “blob”, “varint” or “custom” to a query or bound statement at the specified index.
CassError
cass_statement_bind_bytes_by_name
(CassStatement *
statement, const char *
name, const cass_byte_t *
value, size_t
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.
CassError
cass_statement_bind_bytes_by_name_n
(CassStatement *
statement, const char *
name, size_t
name_length, const cass_byte_t *
value, size_t
value_size )
Same as CassStatement::cass_statement_bind_bytes_by_name
, but with lengths for string parameters.
CassError
cass_statement_bind_custom
(CassStatement *
statement, size_t
index, const char *
class_name, const cass_byte_t *
value, size_t
value_size )
Binds a “custom” to a query or bound statement at the specified index.
CassError
cass_statement_bind_custom_n
(CassStatement *
statement, size_t
index, const char *
class_name, size_t
class_name_length, const cass_byte_t *
value, size_t
value_size )
Same as CassStatement::cass_statement_bind_custom
, but with lengths for string parameters.
CassError
cass_statement_bind_custom_by_name
(CassStatement *
statement, const char *
name, const char *
class_name, const cass_byte_t *
value, size_t
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.
CassError
cass_statement_bind_custom_by_name_n
(CassStatement *
statement, const char *
name, size_t
name_length, const char *
class_name, size_t
class_name_length, const cass_byte_t *
value, size_t
value_size )
Same as CassStatement::cass_statement_bind_custom_by_name
, but with lengths for string parameters.
Binds a “uuid” or “timeuuid” to a query or bound statement at the specified index.
CassError
cass_statement_bind_uuid_by_name
(CassStatement *
statement, const char *
name, CassUuid
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.
CassError
cass_statement_bind_uuid_by_name_n
(CassStatement *
statement, const char *
name, size_t
name_length, CassUuid
value )
Same as CassStatement::cass_statement_bind_uuid_by_name
, but with lengths for string parameters.
Binds an “inet” to a query or bound statement at the specified index.
CassError
cass_statement_bind_inet_by_name
(CassStatement *
statement, const char *
name, CassInet
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.
CassError
cass_statement_bind_inet_by_name_n
(CassStatement *
statement, const char *
name, size_t
name_length, CassInet
value )
Same as CassStatement::cass_statement_bind_inet_by_name
, but with lengths for string parameters.
CassError
cass_statement_bind_decimal
(CassStatement *
statement, size_t
index, const cass_byte_t *
varint, size_t
varint_size, cass_int32_t
scale )
Bind a “decimal” to a query or bound statement at the specified index.
CassError
cass_statement_bind_decimal_by_name
(CassStatement *
statement, const char *
name, const cass_byte_t *
varint, size_t
varint_size, cass_int32_t
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.
CassError
cass_statement_bind_decimal_by_name_n
(CassStatement *
statement, const char *
name, size_t
name_length, const cass_byte_t *
varint, size_t
varint_size, cass_int32_t
scale )
Same as CassStatement::cass_statement_bind_decimal_by_name
, but with lengths for string parameters.
CassError
cass_statement_bind_duration
(CassStatement *
statement, size_t
index, cass_int32_t
months, cass_int32_t
days, cass_int64_t
nanos )
Binds a “duration” to a query or bound statement at the specified index.
Requires Cassandra: 3.10+
CassError
cass_statement_bind_duration_by_name
(CassStatement *
statement, const char *
name, cass_int32_t
months, cass_int32_t
days, cass_int64_t
nanos )
Binds a “duration” to all the values with the specified name.
Requires Cassandra: 3.10+
CassError
cass_statement_bind_duration_by_name_n
(CassStatement *
statement, const char *
name, size_t
name_length, cass_int32_t
months, cass_int32_t
days, cass_int64_t
nanos )
Same as CassStatement::cass_statement_bind_duration_by_name
, but with lengths for string parameters.
Requires Cassandra: 3.10+
CassError
cass_statement_bind_collection
(CassStatement *
statement, size_t
index, const CassCollection *
collection )
Bind a “list”, “map” or “set” to a query or bound statement at the specified index.
CassError
cass_statement_bind_collection_by_name
(CassStatement *
statement, const char *
name, const CassCollection *
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.
CassError
cass_statement_bind_collection_by_name_n
(CassStatement *
statement, const char *
name, size_t
name_length, const CassCollection *
collection )
Same as CassStatement::cass_statement_bind_collection_by_name
, but with lengths for string parameters.
CassError
cass_statement_bind_tuple
(CassStatement *
statement, size_t
index, const CassTuple *
tuple )
Bind a “tuple” to a query or bound statement at the specified index.
Requires Cassandra: 2.1+
CassError
cass_statement_bind_tuple_by_name
(CassStatement *
statement, const char *
name, const CassTuple *
tuple )
Bind a “tuple” to all the values with the specified name.
Requires Cassandra: 2.1+
CassError
cass_statement_bind_tuple_by_name_n
(CassStatement *
statement, const char *
name, size_t
name_length, const CassTuple *
tuple )
Same as CassStatement::cass_statement_bind_tuple_by_name
, but with lengths for string parameters.
Requires Cassandra: 2.1+
CassError
cass_statement_bind_user_type
(CassStatement *
statement, size_t
index, const CassUserType *
user_type )
Bind a user defined type to a query or bound statement at the specified index.
Requires Cassandra: 2.1+
CassError
cass_statement_bind_user_type_by_name
(CassStatement *
statement, const char *
name, const CassUserType *
user_type )
Bind a user defined type to a query or bound statement with the specified name.
Requires Cassandra: 2.1+
CassError
cass_statement_bind_user_type_by_name_n
(CassStatement *
statement, const char *
name, size_t
name_length, const CassUserType *
user_type )
Same as CassStatement::cass_statement_bind_user_type_by_name
, but with lengths for string parameters.
Requires Cassandra: 2.1+
Sets the execution profile to execute the statement with.
Note: NULL or empty string will clear execution profile from statement
CassError
cass_statement_set_execution_profile_n
(CassStatement *
statement, const char *
name, size_t
name_length )
Same as CassStatement::cass_statement_set_execution_profile
, but with lengths for string parameters.