diff -r 4816d766a08a -r f345bda72bc4 Symbian3/PDK/Source/GUID-3CCA6503-54DA-5558-85DC-93A22A81F565.dita --- a/Symbian3/PDK/Source/GUID-3CCA6503-54DA-5558-85DC-93A22A81F565.dita Tue Mar 30 11:42:04 2010 +0100 +++ b/Symbian3/PDK/Source/GUID-3CCA6503-54DA-5558-85DC-93A22A81F565.dita Tue Mar 30 11:56:28 2010 +0100 @@ -1,44 +1,44 @@ - - - - - -Reading -to Memory -

This tutorial describes how to copy data from the table to a memory location.

-
Introduction

You can avoid making a local copy -of the data by directly writing the retrieved data into a memory location. -This can be achieved by copying to an object of the TPtrC class. -For more details on copying data to a buffer see Reading -to a Buffer.

-
Basic procedure

The high level steps to copy the -data retrieved from a table to a memory location are shown below:

    -
  1. Configure your SQL statement.

  2. -
  3. Copy to memory.

  4. -
-
Detailed steps

Configure your SQL statement

Instantiate -an object of the RSqlStatement class and declare the required -variables as shown.

RSqlStatement myStatement; -TInt err;

Copy to memory

To retrieve all the -entries, use a loop. -

1. Instantiate an object of the TPtrc class. -This object may be used to reference constant strings or data.

... -while((err = myStatement.Next()) == KSqlAtRow) - { - TPtrC myData; - TInt err; -

2 Read the data into the specified memory location..

err = myStatement.ColumnBinary(myColumnIndex,myData); - // process data - }
-
See also

Querying -a Database

Inserting -a Row into a Table

Deleting -Rows from a Table

Reading -to a Buffer

Reading to memory - This document

Reading to a Data Stream

Writing to a Data Stream

Performing Scalar Queries

+ + + + + +Reading +to MemoryThis tutorial describes how to copy data from the table to a memory +location. +
Introduction

You can avoid making a local copy +of the data by directly writing the retrieved data into a memory location. +This can be achieved by copying to an object of the TPtrC class. +For more details on copying data to a buffer see Reading +to a Buffer.

+
Basic procedure

The high level steps to copy the +data retrieved from a table to a memory location are shown below:

    +
  1. Configure your SQL statement.

  2. +
  3. Copy to memory.

  4. +
+
Detailed steps

Configure your SQL statement

Instantiate +an object of the RSqlStatement class and declare the required +variables as shown.

RSqlStatement myStatement; +TInt err;

Copy to memory

To retrieve all the +entries, use a loop.

1. Instantiate an object +of the TPtrc class. This object may be used to reference +constant strings or data.

... +while((err = myStatement.Next()) == KSqlAtRow) + { + TPtrC myData; + TInt err; +

2 Read the data into the specified memory location..

err = myStatement.ColumnBinary(myColumnIndex,myData); + // process data + }
+
See also

Querying +a Database

Inserting +a Row into a Table

Deleting +Rows from a Table

Reading +to a Buffer

Reading to memory - This document

Reading to a Data Stream

Writing to a Data Stream

Performing Scalar Queries

\ No newline at end of file