Rogue Wave banner
Previous fileTop of DocumentContentsIndex pageNext file
DB Access Module for Microsoft SQL Server User's Guide
Rogue Wave web site:  Home Page  |  Main Documentation Page

2.17 Open SQL and Microsoft SQL Server ODBC

The alternative Open SQL interface can be used with Microsoft SQL Server ODBC driver. This section provides some specific details and examples.

2.17.1 Placeholder Syntax

The placeholder syntax for Microsoft SQL Server is simply:

?

Here is an example:

INSERT INTO PICNICTABLE VALUES( ? )

Placeholders are not a portable feature. Different Access Modules use different placeholder syntax.

2.17.2 Supported Data Types for Input Binding

Please see Section 2.15, "Input Binding of Data," for information on the supported data types.

2.17.3 RWDBDataCallback and Open SQL

The data callback classes can be used with Microsoft SQL Server to insert and fetch data. These classes are useful for very large data that may not fit in memory for a single database call and are described in Section 15.3, "The Data Callback Classes," in the DB Interface Module User's Guide.

When fetching data, Microsoft SQL Server requires that the columns bound to a data callback must be at the end of the select list. For example, if two columns of type integer and LOB are selected, the integer must come before the LOB in the select list in order to use a data callback for the LOB column.

The DB Access Module for Microsoft SQL Server will fetch only one row on each call to RWDBOSql::fetch().

Multiple rows can be inserted in one call to RWDBOSql::execute(). The number of rows is determined by the entries parameter passed to the constructor of a data callback class or an RWDBTBuffer instance. Please see Chapter 15, "Using the Open SQL Classes," in the DB Interface Module User's Guide for information about array input.

2.17.3.1 Piece Size Setting

The DB Access Module for Microsoft SQL Server sets the piece size for inserting or fetching data to 32768. This value represents bytes in the case of binary data, and code units in the case of character data.

2.17.3.2 RWDBDataCallback::getLength()

When inserting data using data callbacks, some databases need to be provided the total length of the inserted value, which requires overriding the RWDBDataCallback::getLength() method.

2.17.3.3 Stored Procedures and RWDBDataCallback

Stored procedure execution is not supported with the data callback classes.

2.17.4 Stored Procedures and Open SQL

Apart from the data callback classes, you can use the standard ODBC CALL syntax when executing stored procedures with RWDBOSql.



Previous fileTop of DocumentContentsNo linkNext file

Copyright © Rogue Wave Software, Inc. All Rights Reserved.

The Rogue Wave name and logo, and SourcePro, are registered trademarks of Rogue Wave Software. All other trademarks are the property of their respective owners.
Provide feedback to Rogue Wave about its documentation.