Oratcl

INSTALLATION

Oratcl can be added to standard Tcl's tclsh and wish, or to Extended Tcl's
tcl and wishx.  I recommend using Extended Tcl, as the sample programs
require Extended Tcl.

First, I would recommend that you start from a working Tcl/TclX/Tk base.
Compile all the code, run the 'test' targets, try out the tcl and wishx
interpreters.  Install tcl and wishx into public directories (e.g.
/usr/local/bin) and the Tcl, TclX, and Tk library code (e.g., /usr/local/lib)
Also try out the widget demos from the Tk package.  Everything works? Good,
now you can start on Oratcl.

Un-tar the oratcl-2.11 distribution in a sibling directory to tcl7.3, tk3.6,
and tclX7.3a.  

Makefiles are provided to build a standard tclsh and wish or Extended Tcl's 
tcl and wishx.  Copy either Makefile.Tcl or Makefile.TclX to Makefile, and
customize the Makefile for your environment.  Follow the comments in the 
Makefile.  You must also define your Oracle library directory, and uncomment 
one set of defines for ORAVER and OCILIB for Version 6 or Version 7.  

Both Makefiles try to glean certain compile and link flags from Tcl and Tk
Makefiles.  A file "tclflags.mk" is built, and included on subsequent makes.
The Makefile.TclX uses the compile flags, but uses the SYSLIBS definition
in TclX for linking.

After you have customized your Makefile -

"make get-tcl-flags" or simply "make" will build the tclflags.mk the first time.
This step will ask you to review the tclflags.mk file.  If it looks reasonable,
continue.

"make" will copy the AppInit files from Tcl or TclX and add a call to Oratcl's 
initialization function via a sed(1) script.  The oratcl.c and AppInit c 
files will them be compiled, and executables produced.

"make tests" will run a small script to make sure the resulting 
interpreter can access the database.

"make install" will copy the resulting executables and man page into the 
specified directories.

Optionally, you can "make install-wosql" to copy the wosql program to
a directory, and change the #! interpreter line to reflect the Makefile
values.   (Makefile.TclX only)

"make clean" will delete the .o files, executables, formatted man page,
and reset tclflags.mk to a firsttime: target.

You can add Oratcl to other Tcl/Tk interpreters.  Add a call to
"Oratcl_Init(interp)" to your tclAppInit.c or tkAppInit.c module, and link
with libOratcl.a.

Try out the sample Oratcl scripts.  It's also fun to start the tcl
interpreter, and just type in code on the fly.  Try benign SQL commands
at first, say:
	$ ./tcl
	tcl> oralogon scott/tiger       ** use a vaild connect string **
	tcl> oraopen oratcl0
	tcl> orasql oratcl0.0 {select * from emp}
	tcl> orafetch oratcl0.0
	tcl> orafetch oratcl0.0
	tcl> oracols oratcl0.0
	tcl> parray oramsg

Oratcl seems to fit in to the rest of Tcl/Extended Tcl/Tk without
name conflicts;  it does add about 150kb worth of Oracle libraries to
the tcl and wishx binaries on my machine.

Don't forget to copy your new tcl and wishx interpreters to your bin directory.

The man page was written using -man macros.  Use your favorite nroff/troff
formatter, e.g. 
	nroff -man oratcl.man > oratcl.nr
	troff -Talw -man oratcl.man | alw > oratcl.ps
	psroff -Tdtps -t -man oratcl.man > oratcl.ps
	whatever


Tom Poindexter
tpoind@advtech.uswest.com
tpoindex@nyx.cs.du.edu
