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.
- Example 24 (MS SQL Server
stored procedure call)
- Example 27 (TIMESTAMP_STRUCT
and MS SQL Server)
- Example 28 (MS SQL Server and
TEXT column)
- Example 29 (MS SQL Server and
IMAGE column)
- Example 33 (MS SQL Server:
otl_stream::describe_select() and result sets)
- Example 55 (Datatype override
in SELECT, MS SQL Server)
- Example 67 (Simple
Insert/Select and otl_stream::clean() function for
OTL/ODBC and MS SQL Server)
- Example 74 (STL std::strings,
ANSI C++ typecasts, MS SQL Server)
- Example 77 (STL-compliant
OTL/ODBC stream iterators, MS SQL Server)
- Example 99 (otl_value<T>/
otl_compact_value<T,null> /
std::optional<T>, ODBC / MS SQL Server)
- Example 103 (#define
OTL_UNCAUGHT_EXCEPTION_ON, ODBC / MS SQL Server)
- Example 104 (#define
OTL_EXTENDED_EXCEPTION, ODBC / MS SQL Server)
- Example 105 (OTL/ODBC and MS
SQL Server's GUIDs)
- Example 108 (OTL/ODBC and bulk
operations with MS SQL Server's TEXT)
- Example 112 (Group data type
override in SELECT, MS SQL Server)
- Example 120 (OTL_VALUE_TEMPLATE_ON,
OTL_USER_DEFINED_STRING_CLASS_ON, ODBC /
MS SQL
- Example 124
(Insert/Update/Select with MS SQL Server TEXT in
stream mode)
- Example 125
(Insert/Update/Select with MS SQL Server IMAGE in
stream mode)
- Example 131 (Describe
otl_stream's bind variables for MS SQL Server)
- Example 155
(set_transaction_isolation_level, ODBC, MS SQL)
- Example 158 (external logon,
ODBC, MS SQL)
- Example 160
(otl_stream::clean(), cancelling SELECT's fetch
sequence, MS SQL Server)
- Example 163
(otl_stream::clean(), cancelling Result Set's fetch
sequence, MS SQL Server)
- Example 165
(otl_stream::clean(), cleaning the SELECT stream's error
flags, MS SQL Server )
- Example 168
(otl_stream::clean(), cleaning the Result Set stream's
error flags, MS SQL Server )
- Example 170 (#define's
OTL_DEFAULT_XXX_NULL_TO_VAL, MS SQL Server)
- Example 203 (otl_datetime
container with Datetime values down to milliseconds in
MS SQL Server)
- Example 206 (otl_exception,
derived from a base class, MS SQL Server)
- Example 209 (MS SQL Server
and VARBINARY column)
- Example 212
(OTL_ADD_NULL_TERMINATOR_STRING_SIZE,MS SQL Server)
- Example 223 (std::string and
TEXTs, MS SQL Server)
- Example 235 (SQL statement
label, MS SQL Server)
- Example 237 (OTL/ODBC,
accessing the system data dictionary via ODBC functions,
MS SQL Server)
- Example 239 (OTL/ODBC,
accessing the system data dictionary via ODBC functions,
MS SQL Server)
- Example 240 (OTL/ODBC,
accessing the system data dictionary via ODBC functions,
MS SQL Server)
- Example 242 (64-bit integers
(bigint), MS SQL Server, OTL/ODBC)
- Example 247 (user defined
string class and TEXTs, MS SQL Server)
- Example 251 (OTL tracing,
ODBC, MS SQL Server)
- Example 255 (Explict bind
variables in SELECT statement column definitions, ODBC,
MS SQL Server)
- Example 259 (#define
OTL_THROWS_ON_SQL_SUCCESS_WITH_INFO, ODBC, MS SQL
Server)
- Example 262 (OTL stream read
iterator, simple SELECT, MS SQL / ODBC)
- Example 263 (OTL stream read
iterator, implicit result set, MS SQL / ODBC)
- Example 291 (Strict numeric
type checking on SELECTs)
- Example 310 (Stream buffer
size as int,
simple Insert/Select)
- Example 317
(Insert/Update/Select with MS SQL Server TEXT in
stream mode and otl_stream_read_iterator)
- Example 318
(Insert/Update/Select with MS SQL Server IMAGE in
stream mode and otl_stream_read_iterator)
- Example 341 (OTL stream read
iterator, "get by name" functions, MS SQL / ODBC)
- Example 374 (Simple
Insert/Select, otl_connect::operator<<, <<=,
>>)
- Example 381
(Insert/Update/Select, MS SQL TEXT in stream mode, and
std:strings)
- Example 389
(Insert/Update/Select with MS SQL Server TEXT in
stream mode, without otl_lob_stream::set_len())
- Example 390
(Insert/Update/Select with MS SQL Server IMAGE in
stream mode, without otl_lob_stream::set_len())
- Example 448 (Simple
Insert/Select with VARBINARY datatype)
- Example 449 (Simple
Insert/Select with BINARY datatype)
- Example 459 (Simple
Insert/Select with VARBINARY datatype and
otl_stream_read_iterator)
- Example 460 (Simple
Insert/Select with BINARY datatype and
otl_stream_read_iterator)
- Example 468 (MS SQL Server
2005 and VARCHAR(MAX))
- Example 469 (MS SQL Server
2005 and VARBINARY(MAX))
- Example 470 (MS SQL Server
2005, INSERT with OUTPUT clause)
- Example 497
(Insert/Update/Select with MS SQL Server 2005
VARCHAR(MAX) in stream mode)
- Example 498
(Insert/Update/Select with MS SQL Server 2005
VARBINARY(MAX) in stream mode)
- Example 500
(Insert/Update/Select with MS SQL Server 2005
VARCHAR(MAX) in stream mode and
otl_stream_read_iterator)
- Example 501
(Insert/Update/Select with MS SQL Server 2005
VARBINARY(MAX) in stream mode and
otl_stream_read_iterator)
- Example 665 (XML as
varchar_long/otl_long_string on SELECT, and
varchar_long/otl_long_string on INSERT)
- Example 666 (XML as
varchar_long/std::string on SELECT and
varchar_long/std::string on INSERT)
- Example 675 (Simple
Insert/Select/Update #define OTL_ODBC_MULTI_MODE)
- Example 679 (Simple
Insert/Select with smalldatetime)
- Example 680 (Simple
Insert/Select with MS SQL 2008 datetime2)
- Example 681 (Simple
Insert/Select with MS SQL 2008 date)
- Example 682 (Simple
Insert/Select with MS SQL 2008 time)
- Example 683 (Simple
Insert/Select with MS SQL 2008 datetimeoffset)
- Example 684
(Insert/Update/Select with MS SQL Server 2008
VARBINARY(MAX) FILESTREAM in stream mode)
- Example 688 (MS SQL 2005/2008
BACKUP command
- Example 689 (MS SQL 2005/2008
DBCC command
- Example 696 (Customizing the
date format in OTL tracing via #define
OTL_TRACE_FORMAT_DATETIME)
- Example 697 (Skipping to the
end of the row with otl_stream::skip_to_end_of_row())
- Example 713 (END-OF_ROW
check)
- Example 723 (OTL and bulk
operations with MS SQL Server's VARCHAR(MAX))
- Example 724 (OTL and bulk
operations with MS SQL Server's VARBINARY(MAX))
- Example 728 (MERGE statement,
MS SQL)
- Example 731 (Large numbers
(larger than singed 64-bit int))
- Example 739
(get_dirty_buf_len() with INSERT and SELECT)
- Example 743 (Extended /
customized numeric data type support)
- Example 750 (VARCHAR column
bound as RAW[XXX] for reading/writing std::strings that
have null terminators ('\0') in the middle)
- Example 756
(otl_read_from_stream() / otl_write_to_stream() and STL
containers)
- Example 765 (otl_connect_pool)
- Example 770 (OTL stream,
std::variant<>, std::tuple<>,
std::array<char,...>, and std::span<>)
Prev NextContentsGo Home
Copyright © 1996-2024, 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.