Greetings.
I am using Oratcl to connect me to a data base Oracle 10g Express Edition.
Part of my program is:
#!/bin/sh
# \
exec tclsh "$0" ${1+"$@"}
package require Oratcl
package require -exact Oratcl 4.4
set handle [oralogon system/douglas@XE]
set cur [oraopen $handle]
puts "1.cursor..."
if {[oramsg $cur rc] == 0} {
puts "Successfully connected"
} else {
puts "Unable to connect to the database."
}
orasql $cur "SELECT CONTRATO, DIR_IP FROM ACCESO WHERE ESTADO='ACTIVO'"
set row [orafetch $cur]
while {1} {
if {[oramsg $cur rc] != 0} break
puts "entra"
puts $row
puts [llength $row]
puts "first column is: [lindex $row 0]"
puts [format "%-15.15s %s" [lindex $row 0] [lindex $row 1]]
puts "----------"
#puesto de otra forma
puts [lindex $row 0]
puts [lindex $row 1]
set row [orafetch $cur]
}
oraclose $cur
# Se cierra la conexion.
oralogoff $handle
I obtain east result: (the query obtain three rows)
o.Iniciando...
1.cursor...
Successfully connected
entra
0
1
first column is: 0
0
----------
0
entra
0
1
first column is: 0
0
----------
0
entra
0
1
first column is: 0
0
----------
0
Apparently I cannot read the values of columns that the query returns.
Also when use:
orafetch $cur -datavariable row
indicates to me that the option -datavariable is not correct (BAD OPTION).
THANKS AND GREETINGS
Douglas Aparicio Bermudez
I am Douglas again....
When use this form:
while {[orafetch $cur -datavariable row] == 0} {
puts $row
}
I obtain this error:
bad option "
# DBGNUB START: {1 62 {1309 31}}
DbgNub_Do 0 {1 62 {1323 13}} -datavariable
# DBGNUB END
": must be -datavariable, -dataarray, -command, -indexbyname, or -indexbynumberbad option "
# DBGNUB START: {1 62 {1309 31}}
DbgNub_Do 0 {1 62 {1323 13}} -datavariable
# DBGNUB END
": must be -datavariable, -dataarray, -command, -indexbyname, or -indexbynumber
while executing
"orafetch $cur {
# DBGNUB START: {1 62 {1309 31}}
DbgNub_Do 0 {1 62 {1323 13}} -datavariable
# DBGNUB END
} row"
invoked from within
"DbgNub_uplevelCmd 1 $icode"
(procedure "source" line 151)
invoked from within
"source $argv0"
(file "C:/Archivos de programa/ActiveState Komodo IDE 4/lib/support/tcl/appLaunch.tcl" line 107)
THANKS AND GREETINGS
Douglas Aparicio Bermudez
Hello Douglas.
Your debugger assumes that it is working with a version of Oratcl where the command 'orafetch' has a script argument it has to instrument. In OraTcl 4.4 'orafetch's syntax is changed however, not having such a script argument, so the debugger actually instruments a non-script argument, thus giving orafetch something bogus on which it errors.
We changed this behaviour of the debugger on Oct 9, 2008, effectively upgrading it to OraTcl 4.4+.
As your Komodo version is from before that date I recommend that you upgrade to a newer version containing the updated debugger.
The dbgp_tcldebug.exe has to report build 287624 or higher when asked via
dbgp_tcldebug.exe -V
(Run this in DOS shell).
I experienced this problem a few months ago but put it to the back of the list. Cheers for the help
polar bear books