qdb_stmt_exec()

Updated: May 06, 2022

Execute a prepared statement

Synopsis:

#include <qdb/qdb.h>

int qdb_stmt_exec( qdb_hdl_t *db,
                   int stmtid,
                   qdb_binding_t *bindings,
                   uint8_t binding_count );

Arguments:

db
A pointer to the database handle.
stmtid
The ID of a prepared statement to execute.
bindings
An array of qdb_binding_t structures containing the information for binding specific data values to variable parameters in the statement.
binding_count
The number of items in the bindings array.

Library:

qdb

Description:

This function executes a statement previously prepared (compiled) by qdb_stmt_init(). If the SQL string that was passed into qdb_stmt_init() contains variable parameters, you can bind data to these parameters by placing the data values in qdb_binding_t structures and passing in these structures through the bindings argument. Parameters that aren't filled in are treated as NULL.

Returns:

0
Success.
-1
An error occurred (errno is set).

Examples:

See qdb_stmt_init() for an example on how to compile, execute, and free an SQL statement.

Classification:

QNX Neutrino

Safety:  
Interrupt handler No
Signal handler No
Thread Yes