diff -r ebc84c812384 -r 46218c8b8afa Symbian3/PDK/Source/GUID-B9A3B17E-BDEB-5F66-968C-080335A721AC.dita --- a/Symbian3/PDK/Source/GUID-B9A3B17E-BDEB-5F66-968C-080335A721AC.dita Thu Mar 11 15:24:26 2010 +0000 +++ b/Symbian3/PDK/Source/GUID-B9A3B17E-BDEB-5F66-968C-080335A721AC.dita Thu Mar 11 18:02:22 2010 +0000 @@ -1,17 +1,17 @@ - - - - - -Writing from a Data Stream

This tutorial describes how to write data from a data stream to a database.

Introduction

This is useful when populating your database with the results of some other operation.

Basic procedure

The high level steps to write from a data stream to a database table are shown here:

  1. Instantiate the necessary objects.

  2. Write data into the table.

  3. Commit the stream.

Writing from a data stream into a table

The process of writing data from a data stream into a table can be explained as follows:

Instantiate the necessary objects

  1. Instantiate an object of the RSqlStatement and RSqlParamWriteStream class. Also declare the variables as shown.

    RSqlStatement myStatement; -TInt err; -TInt myParameterIndex; -RSqlParamWriteStream myStream; -RBuf buf; + + + + + +Writing from a Data Stream

    This tutorial describes how to write data from a data stream to a database.

    Introduction

    This is useful when populating your database with the results of some other operation.

    Basic procedure

    The high level steps to write from a data stream to a database table are shown here:

    1. Instantiate the necessary objects.

    2. Write data into the table.

    3. Commit the stream.

    Writing from a data stream into a table

    The process of writing data from a data stream into a table can be explained as follows:

    Instantiate the necessary objects

    1. Instantiate an object of the RSqlStatement and RSqlParamWriteStream class. Also declare the variables as shown.

      RSqlStatement myStatement; +TInt err; +TInt myParameterIndex; +RSqlParamWriteStream myStream; +RBuf buf;
    2. Clean up the stack.

      CleanupClosePushL(myStream);

    Write data into the table

    1. Obtain access to the data as a stream of characters.

      User::LeaveIfErrormyStream.BindTextL(myStatement,myParameterIndex));
    2. Write the buffer.

      myStream.WriteL(buf);

    Commit the stream

    Commit the stream. This ensures that the streamed data is written into the table and cannot be rolled back.

    myStream.CommitL();
    See also

    Querying a Database

    Inserting a Row into a Table

    Deleting Rows from a Table

    Reading to a Buffer

    Reading to Memory

    Reading to a Data Stream

    Writing from a Data Stream - This document

    Performing Scalar Queries

    \ No newline at end of file