OTL 4.0, Examples for DB2, Unicode

The examples below show how to use OTL with DB2 and Unicode based strings. At the database level,, the string format may vary (UTF-8, double byte character set (UCS-2), etc). At least at the C++ level all string data gets converted  into 2-byte Unicode characters.  In order to enable OTL/DB2-CLI and Unicode, the following #defines need to be defined: #define OTL_DB2_CLI, #define OTL_UNICODE. Before trying any of the following examples, make sure that your DB2 database supports Unicode.
  1. Example 265  (Unicode Insert/Select and VARCHAR strings with std::array<char16_t,...>)
  2. Example 266 (Simple Unicode Insert/Select and VARGRAPHIC strings)
  3. Example 267 (Simple Unicode Insert/Select with CLOB)
  4. Example 268 (Simple Unicode Insert/Select with DBCLOB)
  5. Example 269 (Simple Unicode Insert/Select with CLOB, and LOB streams)
  6. Example 270 (Simple Unicode Insert/Select with DBCLOB, and LOB streams)
  7. Example 355 (Simple Unicode Insert/Select and #define OTL_UNICODE_CHAR_TYPE)
  8. Example 356 (Unicode VARGRAPHIC Insert/Select and #define OTL_UNICODE_CHAR_TYPE)
  9. Example 357 (Simple Unicode Insert/Select and #define OTL_UNICODE_STRING_TYPE)
  10. Example 358 (Unicode VARGRAPHIC Insert/Select and #define OTL_UNICODE_STRING_TYPE)
  11. Example 367 (Unicode CLOB Insert/Select and #define OTL_UNICODE_STRING_TYPE)
  12. Example 673 (XML as varchar_long/otl_long_unicode_string on SELECT, and varchar_unicode_long/otl_long_string on INSERT)
  13. Example 674 (XML as varchar_long/wstring  on SELECT and varchar_long/wstring on INSERT)
  14. Example 733 (Large numbers (larger than singed 64-bit int) when using OTL_UNICODE)
  15. Example 753 (OTL stream pooling and #define OTL_UNICODE_STRING_TYPE)

Contents  Go Home

Copyright 1996-2017, Sergei Kuchin, email: skuchin@gmail.com, skuchin@gmail.com .

Permission to use, copy, modify and redistribute this document for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.