After connecting to a database, use functions available
in the ibm_db API to prepare and execute SQL statements. The SQL statements
can contain static text, XQuery expressions, or parameter markers
that represent variable input.
Preparing and executing SQL statements with variable input in Python
To prepare and execute an SQL statement that includes variable
input, use the ibm_db.prepare, ibm_db.bind_param,
and ibm_db.execute functions. Preparing a statement
improves performance because the database server creates an optimized
access plan for data retrieval that it can reuse if the statement
is executed again.