RWBasicUString
Class
RWBasicUString from the Essential Tools Module is used for UTF-16 Unicode strings in SourcePro DB. For more details on
RWBasicUString, please see the
SourcePro API Reference Guide.
Class
RWBasicUString can be used to fetch or send UTF-16 data to your Unicode database. Please see your Access Module Guide for information about the Unicode capabilities of your Access Module. The Access Module Guide also provides mapping information that describes the SQL type that
RWBasicUString maps to for the database you use. SourcePro DB can use class
RWBasicUString just as it would use class
RWCString or
RWWString for fetching and retrieving data.
The following example demonstrates the use of
RWBasicUString with
RWDBInserter,
RWDBSelector, and
RWDBReader. Assume that the table,
t1, consists of one column of type
NVARCHAR:
void
executeUsingUnicodeStrings(RWDBDatabase& aDB)
{
RWBasicUString bustring("\346\202\250\345\245\275");
RWDBTable t1 = aDB.table("t1");
RWDBInserter ins = t1.inserter();
ins << bustring;
ins.execute();
RWDBSelector sel = aDB.selector();
sel << t1;
sel.where(t1["a"] == bustring);
RWDBReader rdr = sel.reader();
RWBasicUString outBUString;
while(rdr()) {
rdr >> outBUString;
}
}
You can use
RWBasicUString like any other datatype in SourcePro DB.
NOTE: RWUString from the Internationalization Module can also be used, since it is derived from the Essential Tools datatype RWBasicUString. However, if you are creating an RWDBTBuffer instance with datatype RWUString, you must include the header file <rw/db/tbuffer_ustr.h> instead of <rw/db/tbuffer.h>.