I cannot check this now, but I think the DIO object stores query
results
in a result object and it owns only an instance of it. So probably the
inner query passed to the array method messes with the ongoing results
that drive the forall loop.
if it's correct possible workarounds are:
1) change DIO and build a result stack in DIO to allow multiple queries
2) use 2 instances of db (at the cost of having 2 connections open)
db1 forall "SELECT `products_id` FROM `products`" row {
db2 array "SELECT `specifications_id` FROM `products_specifications`
WHERE `products_id` = '$row(products_id)'" row2
}
-- Massimo
On Tue, 29 Mar 2011 23:12:42 +0400, Cyril Shumff wrote:
Thanks, but my last sql-query is only an example, actually the
problem is much more complicated and there is need to use the "array"
in the body of "forall". Other commands (array, list, etc) in the
body
"forall" also stops a cycle.
29.03.2011 21:43, Jeff Lawson wrote:
If you're trying to get all of the matching specficiation_id's, then
maybe you want something like:
set myspecs [db list "SELECT specifications_id FROM
product_specifications, products WHERE
product_specifications.products_id = products.products_id"]
On Tue, Mar 29, 2011 at 12:19 PM, Cyril Shtumf wrote:
Hello everyone!
I was faced with an insurmountable problem when using the package
DIO. The problem is that the command "forall" returns only one
row, if the body contains the command "array". For example:
db forall "SELECT `products_id` FROM `products`" row {
db array "SELECT `specifications_id` FROM
`products_specifications` WHERE `products_id` =
'$row(products_id)'" row2
}
Alas, I don't know how to fix it. I hope for your help.
---------------------------------------------------------------------
To unsubscribe, e-mail: rivet-dev-unsubscr...@tcl.apache.org [1]
For additional commands, e-mail: rivet-dev-h...@tcl.apache.org
[2]
Links:
------
[1] mailto:rivet-dev-unsubscr...@tcl.apache.org
[2] mailto:rivet-dev-h...@tcl.apache.org
[3] mailto:webmas...@livehistory.ru
---------------------------------------------------------------------
To unsubscribe, e-mail: rivet-dev-unsubscr...@tcl.apache.org
For additional commands, e-mail: rivet-dev-h...@tcl.apache.org