Public Types |
|
| enum | TQueryOptions { EForwardOnly = 0x0, EScrollable = 0x1, ECloseAtCommit = 0x0, EHoldOverCommit = 0x2, EReadOnly = 0x0, EUpdatable = 0x4 } |
| Result set options. These values are used to
build a combined set of options for specifying the behavior of a
RMimerResultSet object.
More... |
|
| enum | TStatementType { EQuery = 1, ENonQuery = 2, EProcedure = 3 } |
| An enumeration to help the application in
determining the type the prepared statement. More... |
|
Public Member Functions |
|
| IMPORT_C void | Cancel () |
| Cancels an ongoing server request. |
|
| IMPORT_C void | Close () |
| Closes this execution environment and
releases any resources held by it. |
|
| IMPORT_C void | CreateL (RMimerDatabase &aMimerDb, const TDesC &aSQL, const enum TQueryOptions aQueryOptions=EForwardOnly) |
| Creates a command object to be used for
executing SQL statements. |
|
| IMPORT_C void | CreateL (RMimerDatabase &aMimerDb, const enum TQueryOptions aQueryOptions=EForwardOnly) |
| Create a command object in a Mimer SQL
database server. |
|
| IMPORT_C TBool | ExecuteL () |
| Executes a prepared statement. |
|
| IMPORT_C TInt | ExecuteNonQueryL () |
| Executes an SQL statement that does not
returns a result set. |
|
| IMPORT_C RMimerParameterData | ExecuteProcedureL () |
| Executes a procedure call on the server.
|
|
| IMPORT_C RMimerResultSet | ExecuteQueryL () |
| Executes an SQL statement that returns a
result set. |
|
| IMPORT_C TInt | GetLastError () |
| Obtain error information about the last
database operation. |
|
| IMPORT_C TInt | GetLastError (TDes &aErrorText) |
| Obtain error information about the last
database operation. |
|
| IMPORT_C RMimerMetaData | GetMetaDataL () |
| Obtains a meta data object describing a
prepared statement. |
|
| IMPORT_C RMimerResultSet | GetResultSet () |
| Gets the result set returned by the last
statement. |
|
| IMPORT_C TInt | GetUpdateCount () |
| Gets the update count of the last statement.
|
|
| IMPORT_C int | PrepareL () |
| Prepares a statement for later execution.
|
|
| IMPORT_C void | SetCommandTextL (const TDesC &aSQL) |
| Sets the SQL command text to execute in
future calls. |
|
| IMPORT_C void | SetParameterL (TInt aParNo, TDesC &aValue) |
| Setting a parameter using a string
descriptor value. |
|
| IMPORT_C void | SetParameterL (TInt aParNo, TUint aValue) |
| Setting a parameter using a TUInt value.
|
|
| IMPORT_C void | SetParameterL (TInt aParNo, TReal32 aValue) |
| Setting a parameter using a TReal32 value.
|
|
| IMPORT_C void | SetParameterL (TInt aParNo, TReal aValue) |
| Setting a parameter using a TReal value.
|
|
| IMPORT_C void | SetParameterL (TInt aParNo, TTime aValue) |
| Setting a parameter using a TTime value.
|
|
| IMPORT_C void | SetParameterL (TInt aParNo, TInt64 aValue) |
| Setting a parameter using a TInt64 value.
|
|
| IMPORT_C void | SetParameterL (TInt aParNo, TInt aValue) |
| Setting a parameter using a TInt value.
|
|
Friends |
|
| class | RMimerMetaData |
| class | RMimerParameterData |
| class | RMimerResultSet |
Each instance may be used to execute one or more SQL statements.
The life of a RMimerCommand handle is to be attached to a database connection using the #Create call. Once the handle is associated with a connection, statements may be defined and executed using SetCommandTextL. Applications may then execute statements by calling either #ExecuteQueryLC, ExecuteNonQueryL, or ExecuteL. Long running queries may be cancelled by calling the Cancel() method.
When an application does not need this object anymore, it is highly recommended to explicitly call the Close method as soon as possible. However, Close is automatically called by the object destructor.
|
|
Result set options. These values are used to build a combined set of options for specifying the behavior of a RMimerResultSet object. |
|
|
An enumeration to help the application in determining the type the prepared statement. |
|
|
Cancels an ongoing server request. Although the cancel request returns immediately, the server is not guaranteed to have been cancelled. This method returns as soon as possible, and the database request may be cancelled at a later time. |
|
|
Closes this execution environment and releases any resources held by it. This method is automatically called by the destructor. |
|
||||||||||||||||
|
Creates a command object to be used for executing SQL statements. All RMimerCommand objects returned belongs to the database connection represented by this object, they will all participate in the same transaction. Creating a command object using this method is shorthand for using #Create, SetCommandTextL, and the PrepareL. The below two code fragments brings the resulting command object to the same state: RMimerCommand command; _LIT(select_M_from_MIMER_ONEROW,"select M from MIMER.ONEROW"); if (i_want_to_use_short_hand) { command.Create(database,select_M_from_MIMER_ONEROW); } else { command.Create(); command.SetCommandText(select_M_from_MIMER_ONEROW); command.PrepareL(); } // The <command> object is now in the same state no matter the value of <i_want_to_use_short_hand>.
|
|
||||||||||||
|
Create a command object in a Mimer SQL database server. Command objects created
|
|
|
Executes a prepared statement.
|
|
|
Executes an SQL statement that does not returns a result set. This includes UPDATE, INSERT and DELETE statements, as well procedure calls and DDL statements. Stored statements of these types may also be executed using the EXECUTE STATEMENT call. The object returned by this method is invalidated whenever PrepareL, #ExecuteQueryLC, #ExecuteProcedureLC or #ExecuteNoNQuery is called.
|
|
|
Executes a procedure call on the server. This call executes a procedure stored on the server. Upon return, a RMimerParameterData object is returned. Use this object to obtain values of output parameters. The object returned by this method is invalidated whenever PrepareL, #ExecuteQueryLC, #ExecuteProcedureLC or #ExecuteNoNQuery is called.
|
|
|
Executes an SQL statement that returns a result set. This includes regular SELECT queries as well as procedure calls returning result sets.
The object returned by this method is invalidated whenever PrepareL, #ExecuteQueryLC, #ExecuteProcedureLC or #ExecuteNoNQuery is called.
|
|
|
Obtain error information about the last database operation. The error information is lost once another operation is performed on the database.
|
|
|
Obtain error information about the last database operation. The error information is lost once another operation is performed on the database.
|
|
|
Obtains a meta data object describing a prepared statement.
|
|
|
Gets the result set returned by the last statement. Obtains the result set of the last executed statement. If the statement did not return a result set, a NULL pointer is returned.
|
|
|
Gets the update count of the last statement. Obtains the update count of the last executed statement. This is the number of rows affected by INSERT, UPDATE or DELETE statements. If the statement was a query, 0 is returned.
|
|
|
Prepares a statement for later execution. Preparing a statement in advance will offer the possibility both to supply parameters to the statement as well as reusing often used statements. The below code snippet demonstrates how to supply parameters to a statement. RMimerCommand command; _LIT(insert_into_OUR_TABLE,"insert into OUR_TABLE values (?,?,?)"); _LIT(a_string,"a sample string"); command.Create(database); command.SetCommandTextL(insert_into_OUR_TABLE); command.PrepareL(); command.SetParameterL(1,12); command.SetParameterL(2,a_string); command.SetParameterL(3,-7); RMimerResultSet resultset = command.ExecuteQueryL();
|
|
|
Sets the SQL command text to execute in future calls. The command text may be set any number of times.
|
|
||||||||||||
|
Setting a parameter using a string descriptor value.
|
|
||||||||||||
|
Setting a parameter using a TUInt value.
|
|
||||||||||||
|
Setting a parameter using a TReal32 value.
|
|
||||||||||||
|
Setting a parameter using a TReal value.
|
|
||||||||||||
|
Setting a parameter using a TTime value.
|
|
||||||||||||
|
Setting a parameter using a TInt64 value.
|
|
||||||||||||
|
Setting a parameter using a TInt value.
|