Overview of working with SQL
Working with a relational database revolves around
sending SQL statements to the Firebird server and retrieving the
The functions to deal
with SQL statements are:
prepare function prepares a SQL statement for (possibly repeated)
execute function executes a previously prepared SQL statement with a
fresh set of parameters (if any)
free_query function releases the resources tied up by a prepared
num_params function returns the number of parameters found in a SQL
statement during preparation.
param_info function returns information about the type and size of
the data exepcted by the Firebird server for each of the parameters
in a prepared SQL statement.
query function prepares and executes a SQL statement in one step.
affected_rows function returns the number of rows affected by a
previously executed statement.
name_result function names a result set, so that it can be
referenced from SQL statements using the WHERE CURRENT OF clause.
gen_id function returns a next sequence number from a Firebird
sequence (a.k.a. generator).
errcode function returns the SQL error code of a previously executed
errmessage function returns a descriptive error message text for a
previously executed SQL statement.
The execute and
query functions can return a result set. Working with such
result sets and free'ing them after use is discussed in the next