tcl and orcale?

tcl and orcale?

Post by Edwin Guenthn » Sat, 30 Nov 1996 04:00:00



Hi.

We are working with mSQL-databases and msqltcl. But I think our project has
become too large, mSQL isn't able to handle the stuff we want to do in
future. So we are thinking of using Orcale instead of mSQL. But we are not
interested to write our applications in C, therefore - is there a
TCL-Interface for Oracle?

thx and bye

--
---------------------------------------------------------------------
                              Edwin Guenthner  
+ Institut fuer Rechneranwendung in Planung und Konstruktion, Uni Karlsruhe

 
 
 

tcl and orcale?

Post by Krishna K. Kuru » Mon, 02 Dec 1996 04:00:00


Edwin Guenthner wrote:

> Hi.

> We are working with mSQL-databases and msqltcl. But I think our project has
> become too large, mSQL isn't able to handle the stuff we want to do in
> future. So we are thinking of using Orcale instead of mSQL. But we are not
> interested to write our applications in C, therefore - is there a
> TCL-Interface for Oracle?

> thx and bye

> --
> ---------------------------------------------------------------------
>                               Edwin Guenthner
> + Institut fuer Rechneranwendung in Planung und Konstruktion, Uni Karlsruhe
> + Email: guent...@rpk.mach.uni-karlsruhe.de

oratcl by Tom Poindexter is a very reliable and efficient interface to
oracle and works well with local as well as remote databases.

I have used it quite extensively in a OLTP environment with fairly
large and complex transactions.

Check out:
http://www.nyx.net/~tpoindex/tcl.html#Oratcl

Krishna

[ tcl.html 7K ]
Tool Command Language (Tcl)

----------------------------------------------------------------------------

Tcl is the creation of Dr. John K. Ousterhout. Tcl was designed as an
embeddable command language, but is strong enough to stand as a general
programming language. Tcl is often associated with its primary extension Tk,
which provides an elegantly simple interface for X Window System
programming.

One of Tcl's design features is that it is easily extended. I've written two
Tcl extensions for two popular relational database systems, Sybase and
Oracle. My extensions are named Sybtcl and Oratcl respectively.

Other Tcl software distributions I've published are TclRobots, a Tcl
programming game New Verion! , Tcl-my-fancy, a Tcl extension configuration
utility, and MSTCL7.3, a port of Tcl/Tk to MS-DOS.

There's serveral Web pages on Tcl, including ones at SCO and Sun. A very
nice Tcl index of sources, code, extensions, FAQs, etc. is HyperTcl

----------------------------------------------------------------------------

Sybtcl

Sybtcl is a Tcl extension that adds an interface to the Sybase relational
database system. Sybtcl creates several new commands in Tcl to connect to a
Sybase server, send SQL statements, fetch return rows, read and write image
columns to files, and query return column names, types, and lengths. In
additon to fetching result rows, output variables and return valuess from
stored procedures can be accessed. Full access to Sybase server return codes
and error message are also available.

Here is a small sample of Sybtcl code that connects to a Sybase server,
sends an SQL query, then prints the results:

set hand [sybconnect "mysybid" "mysybpasswd"]
sybuse $hand pubs2
sybsql $hand "select au_lname, au_fname from authors order by au_lname"
sybnext $hand {
  puts [format "%s, %s" @1 @2]

}

sybclose $hand

Together with Tk, Sybtcl can be a rapid development tool for building X
Window based Sybase applications.

The Sybtcl distribution includes Wisqlite, an X Window based SQL processor.
A sample screen shot is here (15k).

One of the first Sybtcl programmers, De Clarke, has extended Wisqlite into a
very extensive tool, called UCO/Wisql. De has also done work with Sybtcl and
interfacing with WWW to serve campus phone numbers via a web page, and
another application to browse star catalogs. Check out De's Sybtcl-to-WWW
demo page and home page.

The current version is 2.3 released September, 1995, and can be found at
ftp://ftp.neosoft.com/pub/tcl/alcatel/extensions/sybtcl-2.3.tar.gz
Sybtcl 2.3 supports Tcl 7.4 and Tk 4.0.

NEW - Sybtcl 2.4 beta3, supporting Tcl 7.5 is avaiable for testing. It's at
ftp://ftp.neosoft.com/pub/tcl/NEW/sybtcl-2.4b3.tar.gz

----------------------------------------------------------------------------

Oratcl

Oratcl is a Tcl extension that adds an interface to the Oracle relational
database system. Oratcl creates several new commands in Tcl to connect to a
Oracle server, send SQL statements, fetch return rows, read and write image
columns to files, and query return column names, types, and lengths. Oracle
PL/SQL procedures can also be executed and output variables accessed. Full
access to Oracle server return codes and error message are also available.

I wrote Oratcl after writing Sybtcl, and I used Sybtcl as a model. Not
surprisingly, Oratcl shares many features and overall look and feel with
Sybtcl.

Here is a small sample of Oratcl code that connects to an Oracle server,
sends an SQL query, then prints the results:

set logon [oralogon "myoraid/myorapasswd"]
set hand [oraopen $logon]
orasql $hand "select ename, job from emp order by ename"
orafetch $hand {
  puts [format "%s, %s" @1 @2]

}

oralogoff $hand

Together with Tk, Oratcl can be a rapid development tool for building X
Window based Oracle applications.

The Oratcl distribution includes Wosql, an X Window based SQL processor. A
sample screen shot is here (15k). Actually, the screen shot is of Wisqlite,
the SQL processor shipped with Sybtcl. Wosql has only cometic differences,
and Oracle specific functions. All other features of the interface are
shared with Wisqlite.

The current version is 2.4 released Novermber, 1996, and can be found at
ftp://ftp.neosoft.com/pub/tcl/NEW/oratcl-2.4.tar.gz
Oratcl 2.4 supports Tcl 7.5+ and Tk 4.1+.

----------------------------------------------------------------------------

TclRobots

TclRobots is a programming game written in, and uses the Tcl language. In
TclRobots the idea is to write a Tcl program that controls a robot. Your
robot's mission is to seek out and destroy other robots, each running
different control programs. TclRobots provides the arena and a library of
robot control procedures to scan, drive, fire the cannon, etc.

A sample screen shot is here (15k).

Here is a sample TclRobots control program. This program takes the strategy
of finding an opponent, then driving toward and shooting at the target.

#
# TclRobots - sample robot control program
# Tom Poindexter
#
# charger.tr

set dir [rand 360]
set nothing 0
set closest 0

# start of main code

while {1} {

  # look for an opponet
  set rng [scanner $dir 10]

  # if found and inrange
  if {$rng > 0 && $rng < 700} {

    # begin narrow scan
    set start [expr ($dir+20)%360]
    for {set limit 1} {$limit <= 40} {incr limit} {
      set dir [expr ($start-($limit)+360)%360]
      set rng [scanner $dir 1]
      if {$rng > 0 && $rng < 700} {
        # fire a shell, and backup scan so not to miss a moving target
        set nothing 0
        # charge!
        cannon $dir $rng
        drive $dir 70
        incr limit -4
      }
    }
  } else {
    incr nothing
    if {$rng > 700} {set closest $dir}
  }

  drive 0 0
  # check for nothing found in reasonable time
  if {$nothing >= 30} {
    set nothing 0
    drive $closest 100
    after 10000 drive 0 0
  }

  set dir [expr ($dir-20+360)%360]

}

The current version is 2.0 released March, 1996, and can be found at
ftp://ftp.neosoft.com/pub/tcl/alcatel/potpourri/tclrobots-2.0.tar.gz
TclRobots is currently based on Tcl 7.4 and Tk 4.0.

I sponsored a TclRobots tournament on the net September, 1994, and again in
May, 1996. Results of the first two TclRobots Challenges are in
ftp://ftp.neosoft.com/pub/tcl/NEW/challenge-2.tar.gz. and
ftp://ftp.neosoft.com/pub/tcl/alcatel/code/challenge-1.tar.gz.

----------------------------------------------------------------------------

Tcl-my-fancy

Tcl-my-fancy is a simple /bin/sh based tool that aids in the building of Tcl
and Tk interpreters that include serveral extensions. Tcl-my-fancy searches
sibling directories for the Tcl, Tk, and optionally, Extended Tcl libraries,
finds extension libraries (such as Sybtcl, Oratcl, Tcl-DP, BLT, etc.), and
tries to determines the initialization function for the extension library.
Finally, the tclAppInit.c files are created to call each extension's
initialization function, and builds a Makefile that includes all requested
extensions.

The current version is 2.0 released February, 1996, and can be found at
ftp://ftp.neosoft.com/pub/tcl/alcatel/potpourri/tcl-my-fancy-2.0.tar.gz.
Tcl-my-fancy is NOT associated with the Make-A-Wish Foundation of America,
Inc.
Tcl-my-fancy is currently based on Tcl 7.4 and Tk 4.0.

----------------------------------------------------------------------------

MSTCL7.3

MSTCL is a port of Tcl 7.3, Tk 4.0, and TclX 7.3a to MS-DOS. The Tk wish
executable requires Desqview/X from Quarterdeck to run. The command line
executables tclsh and tcl (/w Extended Tcl) interpreters run under vanilla
MS-DOS. The DJ GNU C compiler was used for the port, providing a flat 32 bit
environment. Minimal support for Tcl's 'exec' is provided as a shell to
MS-DOS.

The port is unsupported and was released December, 1993, and can be found at
ftp://ftp.neosoft.com/pub/tcl/alcatel/distrib/mstcl73s.zip for source and
ftp://ftp.neosoft.com/pub/tcl/alcatel/distrib/mstcl73e.zip for executables.

----------------------------------------------------------------------------
Back to Tom Poindexter's Home Page.
Last updated: July 24, 1996