Oratcl for Windows

ORATCL WITH TCL8.1

The oratcl81.dll in this directory has been linked with tcl8.1.
This version takes advantage of the internationalization
featured of Tcl 8.1 and was compiled with the stubs library.


BEFORE YOU BEGIN

Oratcl has been ported to WindowsNT.  Oratcl also works under Windows95.
It has been tested with the latest version of Tcl, 8.0p2.  If you are
running on Windows95 with an earlier version of Tcl (7.6p2 or 8.0) you 
may experience problems when Tcl exits.  If this is the case, you 
should upgrade to Tcl 8.0p2 or better.  

NT has not exhibited this behavior, and Oratcl should work fine with 
Tcl 7.6p2, Tcl 8.0, or Tcl 8.0p1.
 
You must also have a working Oracle client installation on your machine,
as Oratcl uses Oracle DLLs, notably 'ociw32.dll'.
  

INSTALLING ORATCL FOR WINDOWS

Easy install:

I've written a tiny install script.  It figures out which of the two
DLLs to install based on your Tcl version, copies that file to your
Tcl library, makes a pkgIndex.tcl and installs it into a project directory.
First, copy all files in this directory to some directory on your Windows
PC.  e.g., c:\oratcl

To install, copy ALL of the files in the Oratcl ./win directory to your PC, 
and simply run the install.tcl file with your tclsh:

	tclsh76 install.tcl
	or
	tclsh80 install.tcl
	answer 'yes' when prompted.

Manual installation instructions:

1.  Install Oracle for Windows/NT/95.  Make sure you can run
    Sqlplus to connect to your databases.
    Oratcl depends on ociw32.dll, so this must be installed.  My Oracle 
    installation didn't install this (and whichever .dll's are used by
    ociw32.dll) in the windows system directory.  Make sure that your
    Oracle DLLs are in your path set by 'autoexec.bat' (Windows95) or in your
    environment via the 'System' control panel (WindowsNT).
    You should also have the enviroment variable 'ORACLE_HOME' pointing to
    your Oracle installation directory.

2.  Copy the correct oratcl.dll to your Tcl .\lib directory.  Two versions of
    oratcl.dll are supplied, one compiled with Tcl 7.6 (oratcl2576.dll), and 
    the other compiled with Tcl 8.0 (oratcl2580.dll).  Choose the oratcl.dll 
    that corresponds to your Tcl installation, and copy that file to your
    Tcl library directory, changing the version number to that of the
    Oratcl version.

    Eg. if you installed Tcl in C:\Program Files\Tcl, then you should:
    copy oratcl2576.dll  c:\program files\tcl\lib\oratcl25.dll
    or
    copy oratcl2580.dll  c:\program files\tcl\lib\oratcl25.dll

3.  Copy or add pkgIndex.tcl to your Tcl lib directory.  This is so
    the 'package unknown' scripts can resolve the 'package ifneeded' to 
    load the dll.  Tcl 7.6 has a bug in the 'tcl_pkgPath' value that might
    cause problems if you have spaces in the path name (e.g. c:\program files\)
    However, it should work fine from the same place where 'init.tcl' is
    located.  E.g.:
	    copy pkgIndex.tcl c:\program files\tcl\lib\tcl7.6

    The 'install.tcl' script makes a directory adjacent to your Tcl lib
    called 'oratcl25', and creates the pkgIndex.tcl there.

    If you are using Tcl 8.0, you should of course substitute tcl8.0 for the
    Tcl library directory.

4.  Try it out!

    c:\> tclsh80
    % package require Oratcl
    2.5
    % set h [oralogon id/password@SERVER]
    oratcl0
    % set c [oraopen $h]
    % orasql $c .....whatever....

    If you get errors:

    If 'package require' says it can't find package Oratcl:
	    -make sure you've installed the pkgIndex.tcl.
	    -or just load the oratcl.dll manually
		    % load "c:/program files/tcl/lib/oratcl25.dll"
		    (or wherever you put it)
    If 'oralogon' complains about resolving symbols:
	    -make sure you have the Oracle libraries installed and
	     on the PATH

    If 'oralogon' fails, then you have a bad id, password,
    or server definition.  Make sure you can connect to your database using
    SqlPlus.   You should be able to connect with Oratcl using the
    same connect string that works with SqlPlus.


BUILDING ORATCL FOR WINDOWS

My development environment is:
	Windows NT 4.0
	Microsoft Visual C++ 4.0
	Tcl 7.6p2 for Windows
	Tcl 8.0p2 for Windows
	Oracle 7.3 for NT


To rebuild the dll: 

1.  Get the VC libs zip file from Sun.  Unzip these into your Tcl lib
    directory:

	cd \progra~1\tcl\lib
	C:\progra~1\tcl\lib> ftp ftp.sunlabs.com
	ftp> cd pub/tcl
	ftp> get vclibs76.zip

	C:\progra~1\tcl\lib> pkunzip vclibs76

	Tcl 8.0p2 includes the VC libs in the full installation as
	tcl80vc.lib

2.  Modify the makefile as needed.  You'll probably have to change the
    values for the TCL and ORACLE defines to suit.
    The linker will need to find the ociw32.lib file, as well as the
    Tcl include and lib files.

3.  Make it!  
	C:\oratcl> nmake -f makefile.vc

4.  Install it as noted above.


