Code Comments
Programming Forum and web based access to our favorite programming groups.I'm trying to help a developer who has ran into a roadblock with a production application. The production environment is such that upgrading the tcl or oratcl in production is prohibitive... too many systems would need too much testing time to ensure all the systems were not impacted. So, this is a sparc solaris system, running tcl 8.4.7 and oratcl 4.2, linked against Oracle 9.2 . The software sets a series of shell environment variables that tell Oracle that they are going to be accessing kanji data, then they invoke the tcl script which logs into oracle and does its job. A couple of ws ago, the DBAs upgraded the oracle instance to Oracle 10. When this happened, the software was no longer able to log into oracle. The developers narrowed things down to this - if they ceased setting the NLS_LANG variable to japanese_japan.utf8 , they were able to log into oracle, but could not access the data as needed. If they continue to set the NLS_LANG variable, the oratcl login fails. So, it was suggested to me that I set up a test for the developers, where I build oratcl 4.4 against oracle 10, and have them just see if things work appropriately. I did so. Now a new, weird thing is occuring. The test script being used is: $ cat testoratcl.tcl #!/usr/tcl84/bin/tclsh8.4 set auto_path [list /vol/tclsrcsol/tcl84/oratcl4.4/unix $auto_path] package require Oratcl 4.4 proc oracle_logon {} { global lda env set username [exec $env(PDPS_BIN)/getDB name] set password [exec $env(PDPS_BIN)/getDB passwd] set orapasswd "$username/$password" if {[catch {set lda [oralogon $orapasswd]} error]} { puts "Oracle Logon Error" puts "$error." exit 1 } } oracle_logon puts "logon to oracle succeeded" exit 0 $ ls /vol/tclsrcsol/tcl84/oratcl4.4/unix Makefile config.log oralob.o pkgIndex.tcl Makefile-gen config.status oralong.o casrun.lwv libOratcl4.4.so oratcl.o When the above script is executed, the following error is generated: srv19:/home/mhh26$ ./go2.ksh invalid command name "tclPkgUnknown" while executing "tclPkgUnknown Oratcl 4.4" ("package unknown" script) invoked from within "package require Oratcl 4.4" (file "./go.tcl" line 5) That's a new one on me. Anyone have an idea what might be going on here?
Post Follow-up to this messageLarry W. Virden wrote:
> $ cat testoratcl.tcl
> #!/usr/tcl84/bin/tclsh8.4
>
> set auto_path [list /vol/tclsrcsol/tcl84/oratcl4.4/unix $auto_path]
That's your mistake. The original $auto_path is a list, and here
you've dropped it in a list depth level. If you started with
$auto_path == foo bar
You now have $auto_path == /vol/tclsrcsol/tcl84/oratcl4.4/unix {foo bar}
and neither "foo" nor "bar" is still on the path.
In this case, "foo" ought to be [info library], and without
[info library] on the auto_path, Tcl cannot auto-load the portions
of its script library that are auto-loaded, such as the [tclPkgUnknown]
command.
You want:
set auto_path [linsert $auto_path 0 /vol/tclsrcsol/tcl84/oratcl4.4/unix]
DGP
Post Follow-up to this messagePowered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.