Rocksolid Light

News from da outaworlds

mail  files  register  groups  login

Message-ID:  

BOFH excuse #411: Traffic jam on the Information Superhighway.


comp / comp.lang.tcl / Issues with Oratcl 4.6.1 Using Tcl 8.6 and 9.0

SubjectAuthor
* Issues with Oratcl 4.6.1 Using Tcl 8.6 and 9.0greg
`* Re: Issues with Oratcl 4.6.1 Using Tcl 8.6 and 9.0Harald Oehlmann
 `* Re: Issues with Oratcl 4.6.1 Using Tcl 8.6 and 9.0greg
  `- Re: Issues with Oratcl 4.6.1 Using Tcl 8.6 and 9.0Harald Oehlmann

1
Subject: Issues with Oratcl 4.6.1 Using Tcl 8.6 and 9.0
From: greg
Newsgroups: comp.lang.tcl
Organization: A noiseless patient Spider
Date: Wed, 1 Jan 2025 22:32 UTC
Path: news.eternal-september.org!eternal-september.org!.POSTED!not-for-mail
From: gregor.ebbing@gmx.de (greg)
Newsgroups: comp.lang.tcl
Subject: Issues with Oratcl 4.6.1 Using Tcl 8.6 and 9.0
Date: Wed, 1 Jan 2025 23:32:32 +0100
Organization: A noiseless patient Spider
Lines: 165
Message-ID: <vl4fq0$2vca7$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Wed, 01 Jan 2025 23:32:33 +0100 (CET)
Injection-Info: dont-email.me; posting-host="7ca7a3b039635cc80e0be24a90b7714e";
logging-data="3125575"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX183hrZpMD/nuEXiwEmTBDr5XZ1Aef8tqYk="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:Ajbnxe/vje3I5pG6os7WskhRQsE=
Content-Language: de-DE, en-US
View all headers

The new version of Bawt also includes a new Oratcl.
I want to use it under Windows and Linux with Tcl/Tk 9.

Windows
Error Message:

Oratcl_Init(): Failed loading oci.dll symbols with error 126
while executing
load C:/Tcl/lib/Oratcl4.6.1/Oratcl461.dll
(package ifneeded Oratcl 4.6.1" script)
invoked from within
package require Oratcl
Cause: The MSVCR120.dll file, which is part of the Visual C++
Redistributable for Visual Studio 2013 package, is missing or corrupted.
My Solution: Install or repair the Microsoft Visual C++ Redistributable
2013 package.

Tcl 9.0
Problem: Oratcl crashes without an error message when parsing an SQL
statement using oraparse.
Cause: An issue with character encoding between Tcl 9.0 and Oratcl.
My Solution: Enable UTF-8 mode using the following command:
oraconfig $sh utfmode 1
This might be self-evident when working with databases (and Tcl/Tk 9).

Linux
Problem: Difficulties with the Oracle Instant Client, Oratcl, and the
associated library.
Cause: In oratcl.c, the library path is hardcoded to
"$(ORACLE_HOME)/lib" or "$(ORACLE_LIBRARY)".

My Solution: Set the ORACLE_LIBRARY environment variable to the correct
library path.

A similar issue was already discussed here:

https://www.rocksolidbbs.com/devel/article-flat.php?id=20770&group=comp.lang.tcl#20770
Didn't solve the problem for me

These are not necessarily bugs.
So it works with Tcl/Tk 9

Gregor

#!/usr/bin/env tclsh

# Tcl 8.6.16 and Tcl 9
# MS Windows
# Oratcl_Init(): Failed loading oci.dll symbols with error 126
# while executing
# load C:/Tcl/lib/Oratcl4.6.1/Oratcl461.dll
# (package ifneeded Oratcl 4.6.1" script)
# invoked from within
# package require Oratcl
# The MSVCR120.dll file is part of the Visual C++ Redistributable
# for Visual Studio 2013 package. To fix the issue, reinstall the
# Microsoft Visual C++ Redistributable 2013 package.
# Linux
# problem with instant client ,Oratcl and a lib
# in oratcl.c is hard-wired to ORACLE_HOME)/lib or ORACLE_LIBRARY
# Tcl 9
# crashes without error message when parsing (oraparse).
# Setting oraconfig $sh utfmode 1 resolves the issue.

# Set the path for the Instant Client before using Oratcl
switch $::tcl_platform(platform) {
windows {
set ergPath {C:\\app\\instantclient_19_25}
set ::env(PATH) "[file nativename $ergPath];$::env(PATH)"
}
unix {
set ic "/opt/oracle/instantclient_19_25"
set ::env(ORACLE_LIBRARY) [file join $ic "libclntsh[info
sharedlibextension]" ]
}
}

package require Oratcl

# info proc
proc oratclinfo {lh sh {output 1}} {
lappend infoOra "[info nameofexecutable]"
lappend infoOra "package Oratcl: [package provide Oratcl]"
lappend infoOra "tcl_platform: $::tcl_platform(os)"
lappend infoOra "Pointersize (4 -> 32-bit, 8 -> 64-bit): \
$::tcl_platform(pointerSize)"
lappend infoOra "patchlevel [info patchlevel]"
lappend infoOra "orainfo version: [orainfo version]"
lappend infoOra [orainfo server $lh]
lappend infoOra "orainfo status [orainfo status $lh]"
lappend infoOra "logonhandle: [orainfo logonhandle $sh]"
lappend infoOra "orainfo client [orainfo client]"
if {$output} {
puts " Oracle Information"
puts [join $infoOra \n]
puts "\n"
}
return $infoOra
}

# Login handle: $lh
set lh [oralogon "scott/tiger@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)
(HOST=oralx)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=XEPDB1)))"]

# Statement handle: $sh
set sh [oraopen $lh]
# Set utfmode; otherwise, Tcl 9.0 crashes without error message
oraconfig $sh utfmode 1

oratclinfo $lh $sh
# SQL Query
set sql {SELECT * FROM v$nls_parameters \
WHERE parameter LIKE '%CHARACTERSET%'}

try {
puts "Parsing start"
oraparse $sh $sql
# Execute statement
oraexec $sh
puts "Exec OK!"
# Fetch results
puts "\nFetching results:"
while {[orafetch $sh -datavariable row] == 0} {
puts $row
}

} on error {errmsg options} {
# Error handling
puts "Error: $errmsg"
puts "Details: $options"
} finally {
# Free resources
if {[info exists sh]} {
puts [oraclose $sh]
}
if {[info exists lh]} {
puts [oralogoff $lh]
}
puts "End"
}

#########
if {0} {
package Oratcl: 4.6.1
tcl_platform: Linux
Pointersize (4 -> 32-bit, 8 -> 64-bit): 8
patchlevel 9.0.1
orainfo version: 4.6.1
Oracle Database 18c Express Edition Release 18.0.0.0.0 - Production
orainfo status 1
logonhandle: oratcl0
orainfo client 19.25.0.0.0

Parsing start
Exec OK!

Fetching results:
NLS_CHARACTERSET AL32UTF8 3
NLS_NCHAR_CHARACTERSET AL16UTF16 3
0
0
End
}

Subject: Re: Issues with Oratcl 4.6.1 Using Tcl 8.6 and 9.0
From: Harald Oehlmann
Newsgroups: comp.lang.tcl
Organization: A noiseless patient Spider
Date: Mon, 6 Jan 2025 17:32 UTC
References: 1
Path: news.eternal-september.org!eternal-september.org!.POSTED!not-for-mail
From: wortkarg3@yahoo.com (Harald Oehlmann)
Newsgroups: comp.lang.tcl
Subject: Re: Issues with Oratcl 4.6.1 Using Tcl 8.6 and 9.0
Date: Mon, 6 Jan 2025 18:32:40 +0100
Organization: A noiseless patient Spider
Lines: 185
Message-ID: <vlh439$1nebr$1@dont-email.me>
References: <vl4fq0$2vca7$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Mon, 06 Jan 2025 18:32:26 +0100 (CET)
Injection-Info: dont-email.me; posting-host="f1442a5cb878f86e995dff3e2f4edcf8";
logging-data="1816955"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19iHy6awGnn62LPYVRnO/Q4"
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:CY+7uQ1rcQeXqiy6PglhJnWHIlc=
In-Reply-To: <vl4fq0$2vca7$1@dont-email.me>
Content-Language: en-GB
View all headers

Hi Greg,

I suppose, this is a project without maintainer:

https://sourceforge.net/projects/oratcl/

So the typical guys like Christian Werner or Paul Obermeier do something
and revised versions may be found there.

It is alos sad, that tdbc has no oracle module.

The only think you may currently do is to leave a ticket at the project.

Sorry,
Harald

Am 01.01.2025 um 23:32 schrieb greg:
> The new version of Bawt also includes a new Oratcl.
> I want to use it under Windows and Linux with Tcl/Tk 9.
>
> Windows
> Error Message:
>
>    Oratcl_Init(): Failed loading oci.dll symbols with error 126
>    while executing
> load C:/Tcl/lib/Oratcl4.6.1/Oratcl461.dll
>    (package ifneeded Oratcl 4.6.1" script)
>    invoked from within
> package require Oratcl
> Cause: The MSVCR120.dll file, which is part of the Visual C++
> Redistributable for Visual Studio 2013 package, is missing or corrupted.
> My Solution: Install or repair the Microsoft Visual C++ Redistributable
> 2013 package.
>
> Tcl 9.0
> Problem: Oratcl crashes without an error message when parsing an SQL
> statement using oraparse.
> Cause: An issue with character encoding between Tcl 9.0 and Oratcl.
> My Solution: Enable UTF-8 mode using the following command:
> oraconfig $sh utfmode 1
> This might be self-evident when working with databases (and Tcl/Tk 9).
>
> Linux
> Problem: Difficulties with the Oracle Instant Client, Oratcl, and the
> associated library.
> Cause: In oratcl.c, the library path is hardcoded to "$(ORACLE_HOME)/
> lib" or "$(ORACLE_LIBRARY)".
>
> My Solution: Set the ORACLE_LIBRARY environment variable to the correct
> library path.
>
> A similar issue was already discussed here:
>
> https://www.rocksolidbbs.com/devel/article-flat.php?
> id=20770&group=comp.lang.tcl#20770
> Didn't solve the problem for me
>
> These are not necessarily bugs.
> So it works with Tcl/Tk 9
>
> Gregor
>
> #!/usr/bin/env tclsh
>
> #  Tcl 8.6.16 and Tcl 9
> #   MS Windows
> # Oratcl_Init(): Failed loading oci.dll symbols with error 126
> #    while executing
> # load C:/Tcl/lib/Oratcl4.6.1/Oratcl461.dll
> #    (package ifneeded Oratcl 4.6.1" script)
> #    invoked from within
> # package require Oratcl
> # The MSVCR120.dll file is part of the Visual C++ Redistributable
> # for Visual Studio 2013 package. To fix the issue, reinstall the
> # Microsoft Visual C++ Redistributable 2013 package.
> # Linux
> # problem with instant client ,Oratcl and a lib
> # in oratcl.c is hard-wired to ORACLE_HOME)/lib or ORACLE_LIBRARY
> # Tcl 9
> # crashes without error message when parsing (oraparse).
> # Setting oraconfig $sh utfmode 1 resolves the issue.
>
> # Set the path for the Instant Client  before using Oratcl
> switch $::tcl_platform(platform) {
>   windows {
>     set ergPath {C:\\app\\instantclient_19_25}
>     set ::env(PATH) "[file nativename $ergPath];$::env(PATH)"
>   }
>   unix {
>     set ic  "/opt/oracle/instantclient_19_25"
>     set ::env(ORACLE_LIBRARY) [file join $ic "libclntsh[info
> sharedlibextension]" ]
>   }
> }
>
>
> package require Oratcl
>
> # info proc
> proc oratclinfo {lh sh {output 1}} {
>   lappend infoOra "[info nameofexecutable]"
>   lappend infoOra "package Oratcl: [package provide Oratcl]"
>   lappend infoOra "tcl_platform: $::tcl_platform(os)"
>   lappend infoOra "Pointersize (4 -> 32-bit, 8 -> 64-bit): \
>    $::tcl_platform(pointerSize)"
>   lappend infoOra "patchlevel [info patchlevel]"
>   lappend infoOra "orainfo version: [orainfo version]"
>   lappend infoOra [orainfo server $lh]
>   lappend infoOra "orainfo status [orainfo status $lh]"
>   lappend infoOra "logonhandle: [orainfo logonhandle $sh]"
>   lappend infoOra "orainfo client [orainfo client]"
>   if {$output} {
>     puts " Oracle Information"
>     puts [join $infoOra \n]
>     puts "\n"
>   }
>   return $infoOra
> }
>
> # Login handle: $lh
> set lh [oralogon "scott/tiger@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)
> (HOST=oralx)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=XEPDB1)))"]
>
> # Statement handle: $sh
> set sh [oraopen $lh]
> # Set utfmode; otherwise, Tcl 9.0 crashes without error message
> oraconfig $sh utfmode 1
>
> oratclinfo $lh $sh
> # SQL Query
> set sql {SELECT * FROM v$nls_parameters \
> WHERE parameter LIKE '%CHARACTERSET%'}
>
> try {
>   puts "Parsing start"
>   oraparse $sh $sql
>   # Execute statement
>   oraexec $sh
>   puts "Exec OK!"
>   # Fetch results
>   puts "\nFetching results:"
>   while {[orafetch $sh -datavariable row] == 0} {
>     puts $row
>   }
>
> } on error {errmsg options} {
>   # Error handling
>   puts "Error: $errmsg"
>   puts "Details: $options"
> } finally {
>   # Free resources
>   if {[info exists sh]} {
>     puts [oraclose $sh]
>   }
>   if {[info exists lh]} {
>     puts [oralogoff $lh]
>   }
>   puts "End"
> }
>
>
> #########
> if {0} {
>   package Oratcl: 4.6.1
>   tcl_platform: Linux
>   Pointersize (4 -> 32-bit, 8 -> 64-bit): 8
>   patchlevel 9.0.1
>   orainfo version: 4.6.1
>   Oracle Database 18c Express Edition Release 18.0.0.0.0 - Production
>   orainfo status 1
>   logonhandle: oratcl0
>   orainfo client 19.25.0.0.0
>
>   Parsing start
>   Exec OK!
>
>   Fetching results:
>   NLS_CHARACTERSET AL32UTF8 3
>   NLS_NCHAR_CHARACTERSET AL16UTF16 3
>   0
>   0
>   End
> }

Subject: Re: Issues with Oratcl 4.6.1 Using Tcl 8.6 and 9.0
From: greg
Newsgroups: comp.lang.tcl
Organization: A noiseless patient Spider
Date: Mon, 6 Jan 2025 18:56 UTC
References: 1 2
Path: news.eternal-september.org!eternal-september.org!.POSTED!not-for-mail
From: gregor.ebbing@gmx.de (greg)
Newsgroups: comp.lang.tcl
Subject: Re: Issues with Oratcl 4.6.1 Using Tcl 8.6 and 9.0
Date: Mon, 6 Jan 2025 19:56:22 +0100
Organization: A noiseless patient Spider
Lines: 46
Message-ID: <vlh90m$1ok3a$1@dont-email.me>
References: <vl4fq0$2vca7$1@dont-email.me> <vlh439$1nebr$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Mon, 06 Jan 2025 19:56:23 +0100 (CET)
Injection-Info: dont-email.me; posting-host="67270cf4d875ade4c8f7f61615793f98";
logging-data="1855594"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX180WOIaBXugDXEszzDpUAHRt8Nmr/wWPXk="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:HZXDcyLGbNo5eyDQ28SaYpPf7Eo=
Content-Language: de-DE
In-Reply-To: <vlh439$1nebr$1@dont-email.me>
View all headers

Am 06.01.25 um 18:32 schrieb Harald Oehlmann:
> Hi Greg,
>
> I suppose, this is a project without maintainer:
>
> https://sourceforge.net/projects/oratcl/
>
> So the typical guys like Christian Werner or Paul Obermeier do something
> and revised versions may be found there.
>
> It is alos sad, that tdbc has no oracle module.
>
> The only think you may currently do is to leave a ticket at the project.
>
> Sorry,
> Harald
>
>
Hi Harald,
my mistake.
My post came across incorrectly.
Oratcl 4.6.1 works for me with Tcl 9.

The source code and development are active at:

https://github.com/sm-shaw/Oratcl

There is also a very good precompiled library and source code available
at BAWT.
(I can compile it myself by now as well.)

In hindsight, I have also found good descriptions about the Oracle
Instant Client with Oratcl.
https://www.hammerdb.com/docs/ch01s10.html#d0e678

I’m just struggling a bit to get scripts running correctly under Tcl 8.6
and Tcl 9.0 due to UTF-8, CP1252,
umlauts and file formats—especially regarding the correct file format
of the script files for editing under Linux and Windows.

There is nothing that speaks against switching to Tcl 9.

Thanks for the continued development of Tcl/Tk and libraries like Oratcl!

best regards
Gregor

Subject: Re: Issues with Oratcl 4.6.1 Using Tcl 8.6 and 9.0
From: Harald Oehlmann
Newsgroups: comp.lang.tcl
Organization: A noiseless patient Spider
Date: Mon, 6 Jan 2025 20:23 UTC
References: 1 2 3
Path: news.eternal-september.org!eternal-september.org!.POSTED!not-for-mail
From: wortkarg3@yahoo.com (Harald Oehlmann)
Newsgroups: comp.lang.tcl
Subject: Re: Issues with Oratcl 4.6.1 Using Tcl 8.6 and 9.0
Date: Mon, 6 Jan 2025 21:23:10 +0100
Organization: A noiseless patient Spider
Lines: 39
Message-ID: <vlhe2v$1pj92$1@dont-email.me>
References: <vl4fq0$2vca7$1@dont-email.me> <vlh439$1nebr$1@dont-email.me>
<vlh90m$1ok3a$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Mon, 06 Jan 2025 21:22:56 +0100 (CET)
Injection-Info: dont-email.me; posting-host="949aa3c87b5e8f6fb71d43baa2f3b738";
logging-data="1887522"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/kV3gMGnIjxZi5SLW9nxhQ"
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:oh8YL1EnqwEketrSr+P12CrobNk=
In-Reply-To: <vlh90m$1ok3a$1@dont-email.me>
Content-Language: en-GB
View all headers

Great news, Gregor.

I allowed my to put this information here:

https://wiki.tcl-lang.org/page/Oratcl?V=75

Please feel free to revise the wiki page and remove any information what
is not ok any more.

Thanks for all,
Harald

Am 06.01.2025 um 19:56 schrieb greg:
> Oratcl 4.6.1 works for me with Tcl 9.
>
> The source code and development are active at:
>
> https://github.com/sm-shaw/Oratcl
>
> There is also a very good precompiled library and source code available
> at BAWT.
> (I can compile it myself by now as well.)
>
> In hindsight, I have also found good descriptions about the Oracle
> Instant Client with Oratcl.
> https://www.hammerdb.com/docs/ch01s10.html#d0e678
>
> I’m just struggling a bit to get scripts running correctly under Tcl 8.6
> and Tcl 9.0 due to UTF-8, CP1252,
> umlauts  and file formats—especially regarding the correct file format
> of the script files for editing under Linux and Windows.
>
> There is nothing that speaks against switching to Tcl 9.
>
> Thanks for the continued development of Tcl/Tk and libraries like Oratcl!
>
> best regards
> Gregor

1

rocksolid light 0.9.8
clearnet tor