The write stream interface.
The class is used to set binary data or text data into a parameter. This is a also known as binding a parameter.
The class derives from RWriteStream, which means that all RWriteStream public member functions and predefined stream operators << can be used to deal with the parameter data.
If the blob or text data is over 2Mb in size then it is recommended that the RSqlBlobWriteStream or TSqlBlob class is used instead. These classes provide a more RAM-efficient way of writing large amounts of blob or text data to a database.
The following two cases are typical:
CASE 1 - binding a large binary parameter.
RSqlDatabase db;
<open/create "db" object>;
RSqlStatement stmt;
<prepare "stmt" object>;//The SQL statement references large binary parameter
RSqlParamWriteStream paramStream;
CleanupClosePushL(paramStream);
User::LeaveIfError(paramStream.BindBinary(stmt, <parameter_number>));
//Write out the parameter data
paramStream.WriteL(..);
paramStream << <data>;
...
//Commit the stream
paramStream.CommitL();
//Continue with the statement processing issuing Next() or Exec().
TInt rc = stmt.Next();//rc = stmt.Exec()
//Close the stream
CleanupStack::PopAndDestroy(¶mStream);
CASE 2 - binding a large text parameter.
RSqlDatabase db;
<open/create "db" object>;
RSqlStatement stmt;
<prepare "stmt" object>;//The SQL statement references large text parameter
RSqlParamWriteStream paramStream;
CleanupClosePushL(paramStream);
User::LeaveIfError(paramStream.BindText(stmt, <parameter_number>));
//Write out the parameter data
paramStream.WriteL(..);
paramStream << <data>;
...
//Commit the stream
paramStream.CommitL();
//Continue with the statement processing issuing Next() or Exec().
TInt rc = stmt.Next();//rc = stmt.Exec()
//Close the stream
CleanupStack::PopAndDestroy(¶mStream);
RSqlBlobWriteStream
TSqlBlob