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:
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_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_bytes

( statement, index, value )

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.

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, value )

Bind a “decimal” 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_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_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_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_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_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_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_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_bytes_by_name

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

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_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_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_decimal_by_name

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

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_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_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.