Client APIs
API Reference Overview
Create a prepared statement object from a query.  
Note that after calling `duckdb_prepare`, the prepared statement should always be destroyed using
`duckdb_destroy_prepare`, even if the prepare fails.  
If the prepare fails, `duckdb_prepare_error` can be called to obtain the reason why the prepare failed.  
###### Syntax {#docs:api:c:prepared::syntax}  
```c
duckdb_state duckdb_prepare(
duckdb_connection connection,
const char *query,
duckdb_prepared_statement *out_prepared_statement
);
```  
###### Parameters {#docs:api:c:prepared::parameters}  
* `connection`: The connection object
* `query`: The SQL query to prepare
* `out_prepared_statement`: The resulting prepared statement object  
###### Return Value {#docs:api:c:prepared::return-value}  
`DuckDBSuccess` on success or `DuckDBError` on failure.  
<br>