Many Attributes and Options

In trying to be a comprehensive interface to a very wide variety of real-world data sources, ODBC provides a way to tell the application about every minute detail of the driver and data source it’s connected to. There are so many details available via the GetInfo() function—over 200 at the last count—that we’re not going to waste paper listing any of them.

Though some books include the list as a great way of adding impressive bulk, we’ll just direct you to the online version at Microsoft:

http://msdn.microsoft.com/library/sdkdoc/dasdk/odch5fu7.htm

If that URL ceases to work, then use the MSDN search facility at:

http://msdn.microsoft.com/us/dev/

and search for SQLGetInfo returns using the exact phrase option. The link you want will probably just be called SQLGetInfo.[63]

ODBC also provides for a great many knobs and buttons that you can use to tailor the fine details of driver behavior to suit your application. These can be accessed via the following functions:

GetEnvAttr       SetEnvAttr       --  4 attributes
GetConnectAttr   SetConnectAttr   -- 16 attributes
GetStmtAttr      SetStmtAttr      -- 33 attributes

Prior to ODBC 3.x, there was an older set of functions with names that end in Option instead of Attr. These functions are almost identical to those above, but accept a smaller range of attributes. To find details of all these functions, you can use the Microsoft MSDN search procedure described earlier in this section.

The Win32::ODBC module provides access to the GetInfo() ...

Get Programming the Perl DBI now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.