Tclodbc v. 1.6 Reference

Contents


Loading the Extension

The extension is actually a shared function library. The actual form of such library depends of the used operating system. For example, in windows systems these libraries have the extension .dll in their name. The tclodbc library is thus names tclodbc.dll under windows.

The operating systems have some mechanism for specifying a search path, from which there shared libraries are searched when requested. In windows this search path is the same as the application search path, namely the PATH environment variable. The extension library should reside in a directory listed in the search path.

The extension is loaded simply by command:

load tclodbc

This command adds the command database to the tcl command interpreter. This command is used for creating database connection objects.


Creating a Database Connection

database connect id datasource ?userid? ?password?
or
database connect id connectionstring

database configure operation driver attributes

database datasources

database drivers


Database Object Interface

Database object is a dynamically allocated object, created by the database command. The object provides the following methods. The methods are called as commands after the database object identifier.

<any valid SQL-clause> ?argtypedefs? ?args?

disconnect

set option value

get option

commit

rollback

tables

columns ?tablename?

indexes tablename

statement id <sql clause>|tables|columns ?argtypedefs?


Statement Object Interface

Statement object is a dynamically allocated object, created by the statement method of a database object command. The object provides the following methods. The methods are called as commands after the statement object identifier.

run ?args?

execute

fetch

columns ?attribute attribute ...?

set option value

get option

drop


Changes from Previous Versions

v. 1.5

v. 1.6