Prepare an SQL query to be run against the database.
The SQL statement can contain variables that need to be bound to values before the query is to be run. For example,
* p6IDBC *pDB;
* p6IDBCStmt *pStmt;
*
*
* pDB->prepare(
P6TEXT(
"INSERT INTO test1(ID, email) VALUES( 88, 'henry@p6r.com' );"), &pStmt );
*
*
* pDB->prepare(
P6TEXT(
"INSERT INTO test1(ID, email) VALUES( ?, ? );"), &pStmt );
*
*
* pDB->prepare(
P6TEXT(
"INSERT INTO test2(ID, event, sku) VALUES( $1, $2, $3 );"), &pStmt );
*
- Parameters
-
pSql | [ in ] String containing a valid SQL statement |
pStatement | [ out ] A p6IDBCStmt component that can be used to bind parameters to the SQL statement and to execute the query against the openned database. |
- Returns
Success | P6R::eOk | |
Failure | P6R::eNoMemory | Insuffficient memory to properly initialize the component |
P6R::eNotInitialized | A call to initialize() has not been made. |
P6R::eInvalidArg | One of the paramters is NULL. |