Tclodbc v. 2.3 Reference

Contents


Installing and Loading the Package

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 extension is installed as a tcl package. The installation is most easily done with an included installation script, setup.tcl.

After installation the extension is loaded simply by command:

package require tclodbc

This command adds the command database to the tcl command interpreter (or actually loads the package on demand). Command database is used for creating database connection objects as well as for configuring the system data sources.

Quick start for windows users

Unzip the distribution file to an arbitrary directory. With pkunzip, switch -d is required to create subdirectories. After that, run the installation script.

c:\temp>pkunzip -d tclodbc.zip

c:\temp>tclsh setup.tcl
Installation successful.


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 ?matchpattern?

columns ?tablename?

indexes tablename

typeinfo typeid

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

eval proc <sql clause> ?argtypedefs? ?args?

read arrayspec <sql clause> ?argtypedefs? ?args?


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 ?args?

fetch ?arrayName? ?columnNames?

rowcount

columns ?attribute attribute ...?

set option value

get option

drop

eval proc ?args?

read arrayspec ?args?


Changes from Previous Versions

v. 1.5

v. 1.6

v. 1.7

v. 2.0

v. 2.1

v. 2.2

v. 2.3