Choose a function

The following table shows the functions that the provides to send SQL statements to the database server for execution.
Table 1. Statement-execution functions of the
Function Type of statement Statement executed many times or contains input parameters? Query can use implicit cursor?
mi_exec() Query Other valid SQL statements No Yes
mi_exec_prepared_statement() Query Other valid SQL statements Yes Yes
mi_open_prepared_statement() Query only Yes No
As the preceding table shows, you need to consider the following factors when deciding which statement-execution function to use:
  • What type of SQL statement do you need to send?
  • Does your SQL statement contain input parameters?
  • If the SQL statement is a query, can you use an implicit cursor to access the retrieved rows?

Choose the statement-execution function that is appropriate for the needs of your application.