19.4.9 a_rdb_SQLExecute() (execute a preprocessed SQL statement)
- Organization of this subsection
(1) Function
This CLI function executes a preprocessed SQL statement. The function can execute the following SQL statements:
-
DELETE statement
-
INSERT statement
-
PURGE CHUNK statement
-
TRUNCATE TABLE statement
-
SELECT statement
-
UPDATE statement
-
Definition SQL statements
When a_rdb_SQLExecute()is executed on a SELECT statement, a cursor is opened.
(2) Format
signed short a_rdb_SQLExecute ( void *ConnectionHandle, /* In */ void *StatementHandle, /* In */ void *Option /* In */ )
(3) Arguments
- ConnectionHandle
-
Specifies a connection handle.
- StatementHandle
-
Specifies a statement handle.
- Option
-
Specifies NULL.
(4) Return value
-
If a_rdb_SQLExecute() terminates normally, a_rdb_RC_SQL_SUCCESS or a_rdb_RC_SQL_NO_DATA is returned.
-
If execution of the SQL statement is completed successfully, but the disk containing server message log files or client message log files has become full, a_rdb_RC_SQL_WARNING is returned.
-
If an error occurs while messages cannot be output to the client message log file, the error cause code is returned. For details about the error cause code, see 19.8 Return values of the CLI functions.
(5) Notes
-
a_rdb_SQLExecute() cannot be executed in the following cases:
-
Connection has not been established.
-
An invalid statement handle is specified.
-
-
A preprocessed SQL statement must be available for the specified statement handle.
-
To open a cursor that was opened before, you must first close it, and then re-open it.
-
To use a_rdb_SQLFetch() to a fetch row, you must first open the cursor, and then fetch the row.
-
If COMMIT or ROLLBACK (including implicit rollback) is executed, all cursors that are open at that point are closed.