OTL 4.0, Examples for MS SQL / ODBC

The examples below work with MS SQL Server via MS SQL SNAC / ODBC. In general, all of these examples should work with any MS SQL Server  2005 and higher. For more examples, see the Generic ODBC examples.

  1. Example 24 (MS SQL Server stored procedure call)
  2. Example 27 (TIMESTAMP_STRUCT and MS SQL Server)
  3. Example 28 (MS SQL Server and TEXT column)
  4. Example 29 (MS SQL Server and IMAGE column)
  5. Example 33 (MS SQL Server: otl_stream::describe_select() and result sets)
  6. Example 55 (Datatype override in SELECT, MS SQL Server)
  7. Example 67 (Simple Insert/Select and otl_stream::clean() function for OTL/ODBC and MS SQL Server)
  8. Example 74 (STL std::strings, ANSI C++ typecasts, MS SQL Server)
  9. Example 77 (STL-compliant OTL/ODBC stream iterators, MS SQL Server)
  10. Example 99 (otl_value<T>/ otl_compact_value<T,null> / std::optional<T>, ODBC / MS SQL Server)
  11. Example 103 (#define OTL_UNCAUGHT_EXCEPTION_ON, ODBC / MS SQL Server)
  12. Example 104 (#define OTL_EXTENDED_EXCEPTION, ODBC / MS SQL Server)
  13. Example 105 (OTL/ODBC and MS SQL Server's GUIDs)
  14. Example 108 (OTL/ODBC and bulk operations with MS SQL Server's TEXT)
  15. Example 112 (Group data type override in SELECT, MS SQL Server)
  16. Example 120 (OTL_VALUE_TEMPLATE_ON, OTL_USER_DEFINED_STRING_CLASS_ON,  ODBC / MS SQL
  17. Example 124 (Insert/Update/Select with MS SQL Server TEXT  in stream mode)
  18. Example 125 (Insert/Update/Select with  MS SQL Server IMAGE in stream mode)
  19. Example 131 (Describe otl_stream's bind variables for MS SQL Server)
  20. Example 155 (set_transaction_isolation_level, ODBC, MS SQL)
  21. Example 158 (external logon, ODBC, MS SQL)
  22. Example 160 (otl_stream::clean(), cancelling SELECT's fetch sequence, MS SQL Server)
  23. Example 163 (otl_stream::clean(), cancelling Result Set's fetch sequence, MS SQL Server)
  24. Example 165 (otl_stream::clean(), cleaning the SELECT stream's error flags, MS SQL Server )
  25. Example 168 (otl_stream::clean(), cleaning the Result Set stream's error flags, MS SQL Server )
  26. Example 170 (#define's OTL_DEFAULT_XXX_NULL_TO_VAL, MS SQL Server)
  27. Example 203 (otl_datetime container with Datetime values down to milliseconds in MS SQL Server)
  28. Example 206 (otl_exception, derived from a base class, MS SQL Server)
  29. Example 209 (MS SQL Server and VARBINARY column)
  30. Example 212 (OTL_ADD_NULL_TERMINATOR_STRING_SIZE,MS SQL Server)
  31. Example 223 (std::string and TEXTs, MS SQL Server)
  32. Example 235 (SQL statement label, MS SQL Server)
  33. Example 237 (OTL/ODBC, accessing the system data dictionary via ODBC functions, MS SQL Server)
  34. Example 239 (OTL/ODBC, accessing the system data dictionary via ODBC functions, MS SQL Server)
  35. Example 240 (OTL/ODBC, accessing the system data dictionary via ODBC functions, MS SQL Server)
  36. Example 242 (64-bit integers (bigint), MS SQL Server, OTL/ODBC)
  37. Example 247 (user defined string class and TEXTs, MS SQL Server)
  38. Example 251 (OTL tracing, ODBC, MS SQL Server)
  39. Example 255 (Explict bind variables in SELECT statement column definitions, ODBC, MS SQL Server)
  40. Example 259 (#define OTL_THROWS_ON_SQL_SUCCESS_WITH_INFO, ODBC, MS SQL Server)
  41. Example 262 (OTL stream read iterator, simple SELECT, MS SQL / ODBC)
  42. Example 263 (OTL stream read iterator, implicit result set, MS SQL / ODBC)
  43. Example 291 (Strict numeric type checking on SELECTs)
  44. Example 310 (Stream buffer size as int, simple Insert/Select)
  45. Example 317 (Insert/Update/Select with MS SQL Server TEXT  in stream mode and otl_stream_read_iterator)
  46. Example 318 (Insert/Update/Select with MS SQL Server IMAGE  in stream mode and otl_stream_read_iterator)
  47. Example 341 (OTL stream read iterator, "get by name" functions, MS SQL / ODBC)
  48. Example 374 (Simple Insert/Select, otl_connect::operator<<, <<=, >>)
  49. Example 381 (Insert/Update/Select, MS SQL TEXT in stream mode, and std:strings)
  50. Example 389 (Insert/Update/Select with MS SQL Server TEXT  in stream mode, without otl_lob_stream::set_len())
  51. Example 390 (Insert/Update/Select with  MS SQL Server IMAGE in stream mode, without otl_lob_stream::set_len())
  52. Example 448 (Simple Insert/Select with VARBINARY datatype)
  53. Example 449 (Simple Insert/Select with BINARY datatype)
  54. Example 459 (Simple Insert/Select with VARBINARY datatype and otl_stream_read_iterator)
  55. Example 460 (Simple Insert/Select with BINARY datatype and otl_stream_read_iterator)
  56. Example 468 (MS SQL Server 2005 and VARCHAR(MAX))
  57. Example 469 (MS SQL Server 2005 and VARBINARY(MAX))
  58. Example 470 (MS SQL Server 2005, INSERT with OUTPUT clause)
  59. Example 497 (Insert/Update/Select with MS SQL Server 2005 VARCHAR(MAX) in stream mode)
  60. Example 498 (Insert/Update/Select with MS SQL Server 2005 VARBINARY(MAX) in stream mode)
  61. Example 500 (Insert/Update/Select with MS SQL Server 2005 VARCHAR(MAX)  in stream mode and otl_stream_read_iterator)
  62. Example 501 (Insert/Update/Select with MS SQL Server 2005 VARBINARY(MAX)  in stream mode and otl_stream_read_iterator)
  63. Example 665 (XML as varchar_long/otl_long_string on SELECT, and varchar_long/otl_long_string on INSERT)
  64. Example 666 (XML as varchar_long/std::string  on SELECT and varchar_long/std::string on INSERT)
  65. Example 675 (Simple Insert/Select/Update #define OTL_ODBC_MULTI_MODE)
  66. Example 679 (Simple Insert/Select with smalldatetime)
  67. Example 680 (Simple Insert/Select with MS SQL 2008 datetime2)
  68. Example 681 (Simple Insert/Select with MS SQL 2008 date)
  69. Example 682 (Simple Insert/Select with MS SQL 2008 time)
  70. Example 683 (Simple Insert/Select with MS SQL 2008 datetimeoffset)
  71. Example 684 (Insert/Update/Select with MS SQL Server 2008 VARBINARY(MAX) FILESTREAM in stream mode)
  72. Example 688 (MS SQL 2005/2008 BACKUP command
  73. Example 689 (MS SQL 2005/2008 DBCC command
  74. Example 696 (Customizing the date format in OTL tracing via #define OTL_TRACE_FORMAT_DATETIME)
  75. Example 697 (Skipping to the end of the row with otl_stream::skip_to_end_of_row())
  76. Example 713 (END-OF_ROW check)
  77. Example 723 (OTL and bulk operations with MS SQL Server's VARCHAR(MAX))
  78. Example 724 (OTL and bulk operations with MS SQL Server's VARBINARY(MAX))
  79. Example 728 (MERGE statement, MS SQL)
  80. Example 731 (Large numbers (larger than singed 64-bit int))
  81. Example 739 (get_dirty_buf_len() with INSERT and SELECT)
  82. Example 743 (Extended / customized numeric data type support)
  83. Example 750 (VARCHAR column bound as RAW[XXX] for reading/writing std::strings that have null terminators ('\0') in the middle)
  84. Example 756 (otl_read_from_stream() / otl_write_to_stream() and STL containers)
  85. Example 765 (otl_connect_pool)
  86. Example 770 (OTL stream, std::variant<>, std::tuple<>, std::array<char,...>, and std::span<>)

Prev NextContentsGo Home

Copyright © 1996-2023, 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.