Main Page | Class List | File List | Class Members

RMimerResultSet Class Reference

A result set returned by an SQL query. More...

List of all members.


Public Member Functions

IMPORT_C void  Close ()
  The result set is closed.
IMPORT_C TBool  FirstL ()
  Moves to the first row of the result set.
IMPORT_C RReadStream *  GetBinaryStreamLC (TInt aColNo)
  Creates a stream object to return binary data.
IMPORT_C TBool  GetBooleanL (TInt aColNo)
  Returns boolean data to the application.
IMPORT_C void  GetDes16L (TInt aColNo, TDes16 &aDes)
  Returns a 16-bit string to the application.
IMPORT_C void  GetDes8L (TInt aColNo, TDes8 &aDes)
  Returns an 8-bit string to the application.
IMPORT_C HBufC16 *  GetDesC16L (TInt aColNo)
IMPORT_C HBufC8 *  GetDesC8L (TInt aColNo)
HBufC *  GetDesCL (TInt aColNo)
void  GetDesL (TInt aColNo, TDes &aDes)
  Returns string data to the application.
IMPORT_C TInt  GetDiagnostics (TDes *aErrorText)
  Obtain error information about the last database operation.
IMPORT_C TInt64  GetInt64L (TInt aColNo)
  Returns 64-bit integer data to the application.
IMPORT_C TTimeIntervalDays  GetIntervalDaysL (TInt aColNo)
  Returns a day interval value to the application.
IMPORT_C TTimeIntervalHours  GetIntervalHoursL (TInt aColNo)
  Returns an hour interval value to the application.
IMPORT_C TTimeIntervalMicroSeconds  GetIntervalMicroSecondsL (TInt aColNo)
  Returns a microseconds interval value to the application.
IMPORT_C TTimeIntervalMinutes  GetIntervalMinutesL (TInt aColNo)
  Returns a minute interval value to the application.
IMPORT_C TTimeIntervalMonths  GetIntervalMonthsL (TInt aColNo)
  Returns a month interval value to the application.
IMPORT_C TTimeIntervalSeconds  GetIntervalSecondsL (TInt aColNo)
  Returns a second interval value to the application.
IMPORT_C TTimeIntervalYears  GetIntervalYearsL (TInt aColNo)
  Returns a year interval value to the application.
IMPORT_C TInt  GetIntL (TInt aColNo)
  Returns integer data to the application.
IMPORT_C RMimerMetaData  GetMetaDataL ()
  Obtains a meta data object describing this result set.
IMPORT_C TReal32  GetReal32L (TInt aColNo)
  Returns floating point data to the application.
IMPORT_C TReal  GetRealL (TInt aColNo)
  Returns floating point data to the application.
IMPORT_C TTime  GetTimeL (TInt aColNo)
  Returns date time data to the application.
IMPORT_C TUint  GetUintL (TInt aColNo)
  Returns unsigned integer data to the application.
IMPORT_C TBool  IsNull (TInt aColNo)
  Checks if the value of the specified column on the current row represents the SQL NULL value.
IMPORT_C TBool  LastL ()
  Advances current cursor position to the last row of the result set.
virtual IMPORT_C TInt  MdcaCount () const
virtual IMPORT_C TPtrC  MdcaPoint (TInt aIndex) const
IMPORT_C TBool  NextL ()
  Advances current cursor position to the next row of the result set.
IMPORT_C TBool  PreviousL ()
  Moves one row backwards in the result set.

Protected Member Functions

  RMimerResultSet (RMimerCommand *)

Protected Attributes

RMimerCommand command
TInt  curpos
RMimerMetaData  metadata

Friends

class  _RMimerCommand

Detailed Description

A result set returned by an SQL query.

Member Function Documentation

IMPORT_C void RMimerResultSet::Close  ) 
 

The result set is closed.

No further processing can be made afterwards.

IMPORT_C TBool RMimerResultSet::FirstL  ) 
 

Moves to the first row of the result set.

This operation requires that the result set was created to be scrollable.

Returns:
ETrue if the current row after the operation was valid, otherwise EFalse.
IMPORT_C RReadStream* RMimerResultSet::GetBinaryStreamLC TInt  aColNo  ) 
 

Creates a stream object to return binary data.

If the column represents binary data, this method may be used to create a stream object to be used for further reading. One way of using this would be to store non-relational data in BLOB-columns, and use the ExternalizeL and InternalizeL methods to store and retrieve the data to and from the database. An example of such usage are the classes derived from the CPicture interface.

This method may only be used on columns of the following data types: BINARY, BINARY VARYING, and BINARY LARGE OBJECT

Other SQL data types cannot be returned using this method, attempts to do so will throw an error.

Parameters:
aColNo  The column number. First column is column number 1.
Returns:
The created stream read object.
IMPORT_C TBool RMimerResultSet::GetBooleanL TInt  aColNo  ) 
 

Returns boolean data to the application.

If the underlying column type is a numeric type, this method will return EFalse only when the column value is 0, and ETrue otherwise. If the underlying column type is a string or binary type, ETrue is returned if and only if the string is non-empty.

If the underlying column is a single field INTERVAL type (INTERVAL YEAR, INTERVAL MONTH, INTERVAL DAY, INTERVAL HOUR, INTERVAL MINUTE or INTERVAL SECOND) this routine returns EFalse when the interval value is 0, and ETrue otherwise.

The SQL types DATE, TIME, TIMESTAMP, INTERVAL YEAR TO MONTH, INTERVAL DAY TO HOUR, INTERVAL DAY TO MINUTE, INTERVAL DAY TO SECOND, INTERVAL HOUR TO MINUTE, INTERVAL HOUR TO SECOND, INTERVAL MINUTE TO SECOND cannot represent a boolean value. If a boolean value is attempted to be retrieved from these column types, an error is thrown.

If the column value is SQL NULL, EFalse is always returned. Please refer to the IsNull method to detect SQL NULL values.

Parameters:
aColNo  The column number. First column is column number 1.
Returns:
ETrue if the column value was NULL, otherwise EFalse. If the current row is invalid, EFalse is returned.
Exceptions:
KErrMimerInvalidBooleanValue  The value of the underlying column did not represent a boolean value.
IMPORT_C void RMimerResultSet::GetDes16L TInt  aColNo,
TDes16 &  aDes
 

Returns a 16-bit string to the application.

Parameters:
aColNo  The column number. First column is column number 1.
aDes  A 16-bit descriptor where the output string will be placed.
IMPORT_C void RMimerResultSet::GetDes8L TInt  aColNo,
TDes8 &  aDes
 

Returns an 8-bit string to the application.

Parameters:
aColNo  The column number. First column is column number 1.
aDes  A 8-bit descriptor where the output string will be placed.
void RMimerResultSet::GetDesL TInt  aColNo,
TDes &  aDes
[inline]
 

Returns string data to the application.

Parameters:
aColNo  The column number. First column is column number 1.
aDes  A descriptor where the output string will be placed.
IMPORT_C TInt RMimerResultSet::GetDiagnostics TDes *  aErrorText  ) 
 

Obtain error information about the last database operation.

The error information is lost once another operation is performed on the database.

Parameters:
aErrorText  A reference to a descriptor to hold a descriptive error message about the error. If this reference is a NULL pointer, no error text is obtained.
Returns:
The Mimer SQL error code. This error code is a negative number.
IMPORT_C TInt64 RMimerResultSet::GetInt64L TInt  aColNo  ) 
 

Returns 64-bit integer data to the application.

Parameters:
aColNo  The column number. First column is column number 1.
Returns:
The 64-bit integer value.
Exceptions:
KErrMimerInvalidNumericValue  The value of the underlying column did not represent an integer value.
IMPORT_C TTimeIntervalDays RMimerResultSet::GetIntervalDaysL TInt  aColNo  ) 
 

Returns a day interval value to the application.

The underlying SQL data type must be one of the following: INTERVAL DAY, INTERVAL DAY TO HOUR, INTERVAL DAY TO MINUTE, INTERVAL DAY TO SECOND, INTERVAL HOUR, INTERVAL HOUR TO MINUTE, INTERVAL HOUR TO SECOND, INTERVAL MINUTE, INTERVAL MINUTE TO SECOND, or INTERVAL SECOND.

Other SQL data types cannot be returned using this method, attempts to do so will throw an error.

Parameters:
aColNo  The column number. First column is column number 1.
Returns:
The day interval value.
IMPORT_C TTimeIntervalHours RMimerResultSet::GetIntervalHoursL TInt  aColNo  ) 
 

Returns an hour interval value to the application.

The underlying SQL data type must be one of the following: INTERVAL DAY, INTERVAL DAY TO HOUR, INTERVAL DAY TO MINUTE, INTERVAL DAY TO SECOND, INTERVAL HOUR, INTERVAL HOUR TO MINUTE, INTERVAL HOUR TO SECOND, INTERVAL MINUTE, INTERVAL MINUTE TO SECOND, or INTERVAL SECOND.

Other SQL data types cannot be returned using this method, attempts to do so will throw an error.

Parameters:
aColNo  The column number. First column is column number 1.
Returns:
The hour interval value.
IMPORT_C TTimeIntervalMicroSeconds RMimerResultSet::GetIntervalMicroSecondsL TInt  aColNo  ) 
 

Returns a microseconds interval value to the application.

The underlying SQL data type must be one of the following: INTERVAL DAY, INTERVAL DAY TO HOUR, INTERVAL DAY TO MINUTE, INTERVAL DAY TO SECOND, INTERVAL HOUR, INTERVAL HOUR TO MINUTE, INTERVAL HOUR TO SECOND, INTERVAL MINUTE, INTERVAL MINUTE TO SECOND, or INTERVAL SECOND.

Other SQL data types cannot be returned using this method, attempts to do so will throw an error.

Parameters:
aColNo  The column number. First column is column number 1.
Returns:
The microseconds interval value.
IMPORT_C TTimeIntervalMinutes RMimerResultSet::GetIntervalMinutesL TInt  aColNo  ) 
 

Returns a minute interval value to the application.

The underlying SQL data type must be one of the following: INTERVAL DAY, INTERVAL DAY TO HOUR, INTERVAL DAY TO MINUTE, INTERVAL DAY TO SECOND, INTERVAL HOUR, INTERVAL HOUR TO MINUTE, INTERVAL HOUR TO SECOND, INTERVAL MINUTE, INTERVAL MINUTE TO SECOND, or INTERVAL SECOND.

Other SQL data types cannot be returned using this method, attempts to do so will throw an error.

Parameters:
aColNo  The column number. First column is column number 1.
Returns:
The minute interval value.
IMPORT_C TTimeIntervalMonths RMimerResultSet::GetIntervalMonthsL TInt  aColNo  ) 
 

Returns a month interval value to the application.

The underlying SQL data type must be one of the following: INTERVAL YEAR, INTERVAL YEAR TO MONTH, or INTERVAL MONTH.

Other SQL data types cannot be returned using this method, attempts to do so will throw an error.

Parameters:
aColNo  The column number. First column is column number 1.
Returns:
The hour interval value.
IMPORT_C TTimeIntervalSeconds RMimerResultSet::GetIntervalSecondsL TInt  aColNo  ) 
 

Returns a second interval value to the application.

The underlying SQL data type must be one of the following: INTERVAL DAY, INTERVAL DAY TO HOUR, INTERVAL DAY TO MINUTE, INTERVAL DAY TO SECOND, INTERVAL HOUR, INTERVAL HOUR TO MINUTE, INTERVAL HOUR TO SECOND, INTERVAL MINUTE, INTERVAL MINUTE TO SECOND, or INTERVAL SECOND.

Other SQL data types cannot be returned using this method, attempts to do so will throw an error.

Parameters:
aColNo  The column number. First column is column number 1.
Returns:
The second interval value.
IMPORT_C TTimeIntervalYears RMimerResultSet::GetIntervalYearsL TInt  aColNo  ) 
 

Returns a year interval value to the application.

The underlying SQL data type must be one of the following: INTERVAL YEAR, INTERVAL YEAR TO MONTH, or INTERVAL MONTH.

Other SQL data types cannot be returned using this method, attempts to do so will throw an error.

Parameters:
aColNo  The column number. First column is column number 1.
Returns:
The year interval value.
IMPORT_C TInt RMimerResultSet::GetIntL TInt  aColNo  ) 
 

Returns integer data to the application.

Parameters:
aColNo  The column number. First column is column number 1.
Returns:
The integer value.
Exceptions:
KErrMimerInvalidNumericValue  The value of the underlying column did not represent an integer value.
IMPORT_C RMimerMetaData RMimerResultSet::GetMetaDataL  ) 
 

Obtains a meta data object describing this result set.

Returns:
A meta data object describing the result set.
IMPORT_C TReal32 RMimerResultSet::GetReal32L TInt  aColNo  ) 
 

Returns floating point data to the application.

If the parameter contained the SQL NULL value, the returned floating point is the NaN value.

Parameters:
aColNo  The column number. First column is column number 1.
Returns:
The floating point value.
Exceptions:
KErrMimerInvalidNumericValue  The value of the underlying column did not represent a floating point value.
IMPORT_C TReal RMimerResultSet::GetRealL TInt  aColNo  ) 
 

Returns floating point data to the application.

If the parameter contained the SQL NULL value, the returned floating point is the NaN value.

Parameters:
aColNo  The column number. First column is column number 1.
Returns:
The floating point value.
Exceptions:
KErrMimerInvalidNumericValue  The value of the underlying column did not represent a floating point value.
IMPORT_C TTime RMimerResultSet::GetTimeL TInt  aColNo  ) 
 

Returns date time data to the application.

This table clarifies what is being returned depending on the server data types.

SQL type Client value
TIMESTAMP That value
TIME That time on the current date
DATE That date at 00:00:00
CHARACTER
CHARACTER VARYING
NATIONAL CHARACTER
NATIONAL CHARACTER VARYING
If the character string represents a valid SQL standard datetime literal, the value represented by the string is used. Otherwise an error is thrown.
Other SQL data types cannot be casted to a datetime value, and an error will be thrown.
Parameters:
aColNo  The column number. First column is column number 1.
Returns:
The timestamp value.
IMPORT_C TUint RMimerResultSet::GetUintL TInt  aColNo  ) 
 

Returns unsigned integer data to the application.

Parameters:
aColNo  The column number. First column is column number 1.
Returns:
The integer value.
Exceptions:
KErrMimerInvalidNumericValue  The value of the underlying column did not represent an integer value.
IMPORT_C TBool RMimerResultSet::IsNull TInt  aColNo  ) 
 

Checks if the value of the specified column on the current row represents the SQL NULL value.

Parameters:
aColNo  The column number. First column is column number 1.
Returns:
ETrue if the column value was NULL, otherwise EFalse. If the current row is invalid, EFalse is returned.
IMPORT_C TBool RMimerResultSet::LastL  ) 
 

Advances current cursor position to the last row of the result set.

This operation requires that the result set was created to be scrollable.

Returns:
ETrue if the current row after the operation was valid, otherwise EFalse.
IMPORT_C TBool RMimerResultSet::NextL  ) 
 

Advances current cursor position to the next row of the result set.

Returns:
ETrue if the current row after the operation was valid, otherwise EFalse.
IMPORT_C TBool RMimerResultSet::PreviousL  ) 
 

Moves one row backwards in the result set.

This operation requires that the result set was created to be scrollable.

Returns:
ETrue if the current row after the operation was valid, otherwise EFalse.

Submit a comment or suggestion Version 9.2.5b of Mimer C++ API for Symbian OS
Copyright Mimer Information Technology AB, Box 1713, SE-751 47 UPPSALA, Sweden. All Rights Reserved.