# CassPrepared

### struct CassPrepared

A statement that has been prepared cluster-side (It has been pre-parsed and cached).

A prepared statement is read-only and it is thread-safe to concurrently bind new statements. 

### Public Functions

### void cass_prepared_free(const [CassPrepared](#_CPPv412CassPrepared) \*prepared)

Frees a prepared instance.

* **Parameters:**
  **prepared** – **[in]** 

### [CassStatement](https://cpp-rs-driver.docs.scylladb.com/v1.1.0/api/struct.CassStatement.md#_CPPv413CassStatement) \*cass_prepared_bind(const [CassPrepared](#_CPPv412CassPrepared) \*prepared)

Creates a bound statement from a pre-prepared statement.

#### SEE ALSO
cass_statement_free() 

* **Parameters:**
  **prepared** – **[in]** 
* **Returns:**
  Returns a bound statement that must be freed.

### [CassError](https://cpp-rs-driver.docs.scylladb.com/v1.1.0/api/group.CassError.md#_CPPv49CassError) cass_prepared_parameter_name(const [CassPrepared](#_CPPv412CassPrepared) \*prepared, size_t index, const char \*\*name, size_t \*name_length)

Gets the name of a parameter at the specified index.

* **Parameters:**
  * **prepared** – **[in]** 
  * **index** – **[in]** 
  * **name** – **[out]** 
  * **name_length** – **[out]** 
* **Returns:**
  CASS_OK if successful, otherwise an error occurred. 

### const [CassDataType](https://cpp-rs-driver.docs.scylladb.com/v1.1.0/api/struct.CassDataType.md#_CPPv412CassDataType) \*cass_prepared_parameter_data_type(const [CassPrepared](#_CPPv412CassPrepared) \*prepared, size_t index)

Gets the data type of a parameter at the specified index.

* **Parameters:**
  * **prepared** – **[in]** 
  * **index** – **[in]** 
* **Returns:**
  Returns a reference to the data type of the parameter. Do not free this reference as it is bound to the lifetime of the prepared. 

### const [CassDataType](https://cpp-rs-driver.docs.scylladb.com/v1.1.0/api/struct.CassDataType.md#_CPPv412CassDataType) \*cass_prepared_parameter_data_type_by_name(const [CassPrepared](#_CPPv412CassPrepared) \*prepared, const char \*name)

Gets the data type of a parameter for the specified name.

* **Parameters:**
  * **prepared** – **[in]** 
  * **name** – **[in]** 
* **Returns:**
  Returns a reference to the data type of the parameter. Do not free this reference as it is bound to the lifetime of the prepared. 

### const [CassDataType](https://cpp-rs-driver.docs.scylladb.com/v1.1.0/api/struct.CassDataType.md#_CPPv412CassDataType) \*cass_prepared_parameter_data_type_by_name_n(const [CassPrepared](#_CPPv412CassPrepared) \*prepared, const char \*name, size_t name_length)

Same as [cass_prepared_parameter_data_type_by_name()](#struct_cass_prepared_1a5fdb4aa8f75e3286ba57021b6e03f761), but with lengths for string parameters.

#### SEE ALSO
[cass_prepared_parameter_data_type_by_name()](#struct_cass_prepared_1a5fdb4aa8f75e3286ba57021b6e03f761)

* **Parameters:**
  * **prepared** – **[in]** 
  * **name** – **[in]** 
  * **name_length** – **[in]** 
* **Returns:**
  Returns a reference to the data type of the parameter. Do not free this reference as it is bound to the lifetime of the prepared.
