Client APIs
API Reference Overview
Extract all statements from a query.
Note that after calling `duckdb_extract_statements`, the extracted statements should always be destroyed using
`duckdb_destroy_extracted`, even if no statements were extracted.  
If the extract fails, `duckdb_extract_statements_error` can be called to obtain the reason why the extract failed.  
###### Syntax {#docs:api:c:api::syntax}  
```c
idx_t duckdb_extract_statements(
duckdb_connection connection,
const char *query,
duckdb_extracted_statements *out_extracted_statements
);
```  
###### Parameters {#docs:api:c:api::parameters}  
* `connection`: The connection object
* `query`: The SQL query to extract
* `out_extracted_statements`: The resulting extracted statements object  
###### Return Value {#docs:api:c:api::return-value}  
The number of extracted statements or 0 on failure.  
<br>