IICMD

IICMD - TCL extension for INGRES DBMS

Location: http://code.google.com/p/iicmd/

IICMD is an extension for comfortable work with Ingres DBMS from TCL programming language. Platforms available:

Available for Linux as a shared object and for windows as a Dll

What for:

IICMD version 1.2: provides commands for connect to any Ingres database, execute any Ingres SQL, fetch data into TCL list and disconnect from database.


TCL Commands description

iiconnectdb

Usage (from TCL):

iiconnectdb 'servername databasename ?user? ?password?

returns a string which contains unique database connection identifier in Ingres.

iisqlexec

Usage (from TCL):

iisqlexec ?additional option? sql_statement

if executed only with "SQL text" without additional option, returns a 2-dimensioned Tcl list containing a result of SQL select statement, or nothing if SQL statement was not a select.

If statement was a correct select, result list will contain at least 4 elements at following order:

  • list of column names in table;
  • list of conversion functions for each column;
  • list of column types;
  • list of column length;
  • data range list range from 4 to end).

if command executed with additional option, then result contains what was specified in this option.

Additional options:

  1. -data – result will be range of sql data
  2. -colnames – result will be a list of table column names
  3. -length – result will be a list of table column length
  4. -types – result will be a list of table column types
  5. -functions – result will be a list of table column conversion functions

iidisconnectdb

Usage (from TCL):

iidisconnectdb connection_name

Returns nothing; disconnect from specified connection name; If no connection exists, generates an error.

iifilltab

Usage (from TCL):

iifilltab sql_select ?-numbers? ?-colnames?

experimental, not fully tested;

Returns result of select statement as a list in "array set" format; it is very useful with TkTable and works very fast, but may be any errors yet;

  • if -numbers option is specified, any row preceded by its number;
  • if -colnames option is specifyed, any column heads by its name in database;
  • without additional options this function returns only data;