Sybtcl runs on Unix, Windows NT and 95, and Macintosh platforms.
Tcl has several features that make it a highly productive language. First, the language is interpreted. Interpreters allow execution without a compile and link step. Code can be developed with immediate feedback. Second, Tcl has a single data type: string. While this might at first glance seem to a deficiency, it avoids problems of data conversion and memory management. (This feature doesn't preclude Tcl from performing arithmetic operations.) Last, Tcl has a consistent and simple syntax, much the same as the Unix shell. Every Tcl statement is a command name, followed by arguments.
Dr. Ousterhout also developed a companion Tcl extension, called Tk. Tk provides simplified programming of X11 applications with a Motif look and feel. X11 applications can be programmed with 60%-80% less code than equivalent Xt, Motif, or Xview programs using C or C++.
Dr. Ousterhout now leads Tcl/Tk development at Sun Microsystems.
Instead of a simple one-to-one interface to DB-Library, Sybtcl provides a high-level Sybase programming interface of its own. The following example is a complete Sybtcl program that illustrates the simplified interface. It relies on the Tcl interpreter, "tclsh", that has been extended with Sybtcl.
#!/usr/local/bin/tclsh
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
exit
In this example, a Sybase server connection is established ("sybconnect"), and
the "pubs" sample database is accessed ("sybuse"). An SQL statement is
sent to the server ("sybsql"), and all rows returned are fetched and printed
("sybnext"). Finally, the connection is closed ("sybclose").
The same program can be made to display its output in an X11 window, with a few changes. The Tcl/Tk windowing shell, "wish", also extended with Sybtcl is used.
#!/usr/local/bin/wish
listbox .sql_output
button .exit -text exit -command exit
pack .sql_output .exit
set hand [sybconnect "mysybid" "mysybpasswd"]
sybuse $hand pubs2
sybsql $hand "select au_lname, au_fname from authors order by au_lname"
sybnext $hand {
.sql_output insert end [format "%s, %s" @1 @2]
}
sybclose $hand
In addition to these commands, Sybtcl includes commands to access return
column names and datatypes ("sybcols"), return values from stored procedures
("sybretval"), reading and writing of "text" or "image" columns ("sybreadtext",
"sybwritetext"), canceling pending results ("sybcancel"), and polling
asynchronous SQL execution ("sybpoll").
Full access to Sybase server messages is also provided. Sybtcl maintains a Tcl array variable which contains server messages, output from stored procedures ("print"), DB-Library and OS error message.
For a snapshot of Wisqlite in action, look here.
Other applications included in the Sybtcl distribution include:
Tcl/Tk is described in detail in "Tcl and the Tk Toolkit" by Dr. John Ousterhout, Addison-Wesley Publishing 1994 ISBN: 0-201-63337-X . Another recent publication is "Practical Programming in Tcl and Tk" by Brent Welch, Prentice Hall 1995 ISBN 0-13-182007-9.
A wealth of information on Tcl/Tk is available via Internet sources:
news:comp.lang.tcl
http://sunscript.sun.com/
http://www.neosoft.com/tcl/
http://www.sco.com/Technology/tcl/Tcl.html
ftp://ftp.sunlabs.com/pub/tcl
ftp://ftp.neosoft.com/pub/tcl/
Tcl/Tk and Sybtcl are both released in source code form under a "BSD" style license. Tcl/Tk and Sybtcl may be freely used for any purpose, as long as copyright credit is given to the respective owners. Tcl/Tk can be obtained from either anonymous FTP site listed above.
Tcl/Tk and Sybtcl can be easily configured under most modern Unix systems including SunOS, Solaris, HP-UX, Irix, OSF/1, AIX, SCO, et.al. Sybtcl also runs under Windows NT and 95; pre-compiled DLL's are include in the distribution. Sybtcl requires Sybase's DB-Library, from Sybase's Open Client bundle.
Current versions are: