19.4.14 a_rdb_SQLPrepare() (preprocess an SQL statement)
- Organization of this subsection
(1) Function
This CLI function preprocesses an SQL statement. The function can preprocess the following SQL statements:
-
DELETE statement
-
INSERT statement
-
PURGE CHUNK statement
-
TRUNCATE TABLE statement
-
SELECT statement
-
UPDATE statement
-
Definition SQL statements
When a_rdb_SQLPrepare() is executed, the specified SQL statement is preprocessed so that is becomes executable and then the SQL statement is allocated to the specified statement handle.
(2) Format
signed short a_rdb_SQLPrepare ( void *ConnectionHandle, /* In */ void *StatementHandle, /* In */ char *StatementText, /* In */ void *Option /* In */ )
(3) Arguments
- ConnectionHandle
-
Specifies a connection handle.
- StatementHandle
-
Specifies a statement handle.
- StatementText
-
Specifies the text of the SQL statement that is to be preprocessed, expressed as a character string in C or C++.
- Option
-
Specifies NULL.
(4) Return value
-
If a_rdb_SQLPrepare() terminates normally, a_rdb_RC_SQL_SUCCESS is returned.
-
If the SQL statement is preprocessed 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_SQLPrepare() cannot be executed in the following cases:
-
Connection has not been established.
-
An invalid statement handle is specified.