standard.db.sql.ODBCExecute

ODBCExecute is available since version 1.0.

Prototype:

number ODBCExecute(string query, number statement)

Parameters

query
the SQL query
statement
the statement handle (or result set) as returned by ODBCStatement.

Description:

Execute a prepared query. A prepared query contains bounded parameters via the ODBCAddParameter function.

If you want to build a prepared query, the order is this:
ODBCStatement
for each parameter in the query, ODBCAddParameter
ODBCExecute

This function is considered safer when dealing with data from the user.

In addition, you may want to check the ODBCExecuteQuery as a convenient alternative.

After a query that provides results is successfully executed, you must call {ODBCBind} in order to be able to access the data in the result set (result set is the same as statement handle).

Return value:

Return -1 if failed (call ODBCError to retrieve the error), -3 if the statement contains unbound parameters or 0 if succeeded.