I have been playing around abit lately with the mysqltcl API, but I've stumbled upon something that I do not understand. From what I can gather from the manual and this example, using mysql::moreresult should return true if there are more data available from a SELECT statement. This is the code I'm running:
Code: Select all
set sqlLink [::mysql::connect -host $sqlHostname -user $sqlUsername -password $sqlPassword -db $sqlDatabase]
set sql "SELECT * FROM tcltest"
set query [::mysql::query $sqlLink $sql]
puts "moreresult: [::mysql::moreresult $query]"
if {[::mysql::moreresult $query]} {
puts [::mysql::fetch $query]
puts [::mysql::fetch $query]
puts [::mysql::fetch $query]
}
Code: Select all
keung@coeus:~/tcl$ ./mysql.tcl
moreresult: 0
Code: Select all
keung@coeus:~/tcl$ ./mysql.tcl
moreresult: 0
1 keung gnuek ungke
2 bla inst prep
3 eon pondus m
