Re: [Q] SQL calls from UNIX scripts?

From: Tom Poindexter <tpoind_at_advtech.uswest.com>
Date: 11 Jun 1994 00:13:46 GMT
Message-ID: <2tavjq$1dm_at_cherokee.advtech.uswest.com>


In article <WORTHEN.94Jun10090429_at_gandalf.ncssm.edu> worthen_at_gandalf.ncssm.edu (Andrew Worthen) writes: [...]
>of Perl called OraPerl provides support for interfacing Oracle. It is
>available from demon.co.uk in the directory /pub/perl/db/oraperl.
[...]

I would also add Oratcl and Sybtcl, interfaces for Oracle and Sybase to the Tool Command Language (Tcl).

Tcl also has a advantage of using Tk, the X11 widget set for building GUI applications. Both Oratcl and Sybtcl come with a windowing SQL processor, and a few other sample applications.

I run Tcl/Tk interpreters that contain both extensions, so one could access both database from the same application.

All the code for Tcl/Tk, Oratcl, Sybtcl and a whole lot more are available at the Tcl archive site, harbor.ecn.purdue.edu:/pub/tcl/*. Also see the newgroup comp.lang.tcl.

A sample piece of Oratcl code:

#!/usr/local/bin/tcl -f
set handle [oralogon id/password_at_sid] set cursor [oraopen $handle]
orasql $cursor "select count(*) from a_table" set result [orafetch $cursor]
if {$result == 0} {
  echo "no rows in a_table"
} else {
 echo "a_table has $result rows"
}
oralogoff $handle

Have fun!

-- 
Tom Poindexter     tpoind_at_advtech.uswest.com  or  tpoindex_at_nyx.cs.du.edu  
U S WEST Advanced Technologies,  Boulder, Colorado
"I hate it when that happens"
Received on Sat Jun 11 1994 - 02:13:46 CEST

Original text of this message