struct CassStatement
A statement object is an executable query. It represents either a regular (adhoc) statment or a prepared statement. It maitains 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
Creates a new query statement.
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 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.
Sets the statement’s consistency level.
Default: CASS_CONSISTENCY_ONE
CassError
cass_statement_set_serial_consistency
(CassStatement *
statement, CassConsistency
serial_consistency )
Sets the statement’s serial consistency level.
Default: Not set
Sets the statement’s page size.
Default: -1 (Disabled)
Sets the statement’s paging state.
Binds null to a query or bound statement at the specified index.
CassError
cass_statement_bind_int32
(CassStatement *
statement, cass_size_t
index, cass_int32_t
value )
Binds an “int” to a query or bound statement at the specified index.
CassError
cass_statement_bind_int64
(CassStatement *
statement, cass_size_t
index, cass_int64_t
value )
Binds a “bigint”, “counter” or “timestamp” to a query or bound statement at the specified index.
CassError
cass_statement_bind_float
(CassStatement *
statement, cass_size_t
index, cass_float_t
value )
Binds a “float” to a query or bound statement at the specified index.
CassError
cass_statement_bind_double
(CassStatement *
statement, cass_size_t
index, cass_double_t
value )
Binds a “double” to a query or bound statement at the specified index.
CassError
cass_statement_bind_bool
(CassStatement *
statement, cass_size_t
index, cass_bool_t
value )
Binds a “boolean” to a query or bound statement at the specified index.
CassError
cass_statement_bind_string
(CassStatement *
statement, cass_size_t
index, CassString
value )
Binds a “ascii”, “text” or “varchar” to a query or bound statement at the specified index.
CassError
cass_statement_bind_bytes
(CassStatement *
statement, cass_size_t
index, CassBytes
value )
Binds a “blob” or “varint” to a query or bound statement at the specified index.
Binds a “uuid” or “timeuuid” to a query or bound statement at the specified index.
Binds an “inet” to a query or bound statement at the specified index.
CassError
cass_statement_bind_decimal
(CassStatement *
statement, cass_size_t
index, CassDecimal
value )
Bind a “decimal” to a query or bound statement at the specified index.
CassError
cass_statement_bind_custom
(CassStatement *
statement, cass_size_t
index, cass_size_t
size, cass_byte_t **
output )
Binds any type to a query or bound statement at the specified index. A value can be copied into the resulting output buffer. This is normally reserved for large values to avoid extra memory copies.
CassError
cass_statement_bind_collection
(CassStatement *
statement, cass_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_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
.
CassError
cass_statement_bind_int64_by_name
(CassStatement *
statement, const char *
name, cass_int64_t
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
.
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
.
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
.
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
.
CassError
cass_statement_bind_string_by_name
(CassStatement *
statement, const char *
name, CassString
value )
Binds a “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
.
CassError
cass_statement_bind_bytes_by_name
(CassStatement *
statement, const char *
name, CassBytes
value )
Binds a “blob” or “varint” to all the values with the specified name.
This can only be used with statements created by CassPrepared::cass_prepared_bind
.
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
.
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
.
CassError
cass_statement_bind_decimal_by_name
(CassStatement *
statement, const char *
name, CassDecimal
value )
Binds a “decimal” to all the values with the specified name.
This can only be used with statements created by CassPrepared::cass_prepared_bind
.
CassError
cass_statement_bind_custom_by_name
(CassStatement *
statement, const char *
name, cass_size_t
size, cass_byte_t **
output )
Binds any type to all the values with the specified name. A value can be copied into the resulting output buffer. This is normally reserved for large values to avoid extra memory copies.
This can only be used with statements created by CassPrepared::cass_prepared_bind
.
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
.