Updated 2012-10-27 21:07:00 by xenu

Purpose: A collection of notes on interacting with INGRES databases using Tcl.

See ftp://ftp.procplace.com/pub/tcl/sorted/databases/tclsql-1.1/ for a Tcl extension written using the Ingres C API.

CAU: My day job requires that I regularly interact with the Ingres database. So this is a collection of notes about using Ingres with Tcl.

Background: Several standard tools exist for interacting with Ingres, including:

  • qbf - Query by forms
  • isql - Interactive terminal monitor (itm)
  • sql - Terminal monitor (tm)

I have listed these in order of simplicity, easiest first (most useful last!).

QBF and ISQL being forms based method of interaction, the most useful of the standard tools is the sql terminal monitor command line based interface. The sql interface requires that the user interacts by typing queries on the command line, followed by instructions such as \p (print query), \g or \go (execute query). All output from transactions is formatted in a tabular format with certain notifications that the SQL is Executing ... or has returned (2 rows), etc., and prompts for the user to continue. This simple, consistent input/notifications/output format allows us to write a layer in Tcl to handle interaction with the database. In theory, expect would be a good candidate for this interaction, but writing a layer in pure Tcl (and using core tcllib functionality) provides for more diverse imlementation options.

See INGRES - tm wrapper for basic session enabled Tcl code.

I have written simple Ingres interface for Tcl, more info is available here: IngTcl