Type of statement
The DataBlade®
API statement-execution
functions can execute the following types of SQL statements:
- An SQL statement that does not return rows of data (is not a SELECT
statement and not an EXECUTE FUNCTION statement that executes an iterator
function).
Most SQL statements do not return rows. For example, all data definition (DDL) statements and most data manipulation (DML) statements return only a status to indicate the statements success.
- An SQL statement that does return one or more rows of data.The following SQL statements return rows:
- SELECT statement
- EXECUTE FUNCTION statement, when the user-defined function returns more than one row of data
An SQL statement that returns rows is often called a query because it asks the database server to answer a question: which rows match?
Tip: The term query is sometimes used
to refer to any SQL statement. However, this publication uses the
more specific definition of query: an SQL statement that returns rows.
The following table shows how to choose a DataBlade®
API statement-execution
function based on the type of SQL statement.
Type of statement | DataBlade® API function |
---|---|
Query, Other valid statements | mi_exec(), mi_exec_prepared_statement() |
Query only | mi_open_prepared_statement() |