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

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 *

same as CassStatement::cass_statement_new

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

same as CassStatement::cass_statement_set_keyspace

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.

Parameters:
Name Type Details
in statement
in result
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 a “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

same as CassStatement::cass_statement_bind_string

See Also:
CassError

cass_statement_bind_bytes

( statement, index, value, value_size )

Binds a “blob” or “varint” 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_custom

( statement, index, size, 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.

Parameters:
Name Type Details
in statement
in index
in size
out output
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_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

same as CassStatement::cass_statement_bind_null_by_name

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

same as CassStatement::cass_statement_bind_int32_by_name

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

same as CassStatement::cass_statement_bind_float_by_name

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

same as CassStatement::cass_statement_bind_double_by_name

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

same as CassStatement::cass_statement_bind_bool_by_name

See Also:
CassError

cass_statement_bind_string_by_name

( statement, name, 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.

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

same as CassStatement::cass_statement_bind_string_by_name

See Also:
CassError

cass_statement_bind_bytes_by_name

( statement, name, value, value_size )

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.

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

same as CassStatement::cass_statement_bind_bytes_by_name

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

same as CassStatement::cass_statement_bind_uuid_by_name

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

same as CassStatement::cass_statement_bind_inet_by_name

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

same as CassStatement::cass_statement_bind_decimal_by_name

See Also:
CassError

cass_statement_bind_custom_by_name

( statement, name, size, 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.

Parameters:
Name Type Details
in statement
in name
in size
out output
Returns:
Type Details
CassError

CASS_OK if successful, otherwise an error occurred.

CassError

cass_statement_bind_custom_by_name_n

( statement, name, name_length, size, output )

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 size
out output
Returns:
Type Details
CassError

same as CassStatement::cass_statement_bind_custom_by_name

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: