Hi,

I mentioned the problem before but it seems to be ignored for now. I'd 
really appreciate some response, at least confirmation or denial that 
I'm right about the problem.

Quoting from previous thread:

--- QUOTE ---
select a1.txt, a2.txt
   from a a1
   join a a2
        using (ref)
  where a1.lang = 'french'
        and
        a2.lang = 'english';
--- END OF QUOTE ---

Note, that the "SELECT" is not known to application - it's custom select 
typed by end-user, so I don't deciede about "AS" aliases for columns.

--- QUOTE ---
We can either use:
db eval $query arr {
   parray arr
}

But then we would have arr(*) = a.txt a.txt but only one array entry: 
arr(a.txt).

Other way is to use:

set results [db eval $query]
foreach cellValue $results {
   puts $cellValue
}

But then we lose informations about column names in results.

One of possible solutions would be to add some prefix or suffix to array 
indexes.

Other one would be to provide column names in results of [db eval $query],
using for example flag, like: [db eval $query -withColumnNames] or 
something
like that. The results would be: [list $columnList $tableDataList]
--- END OF QUOTE ---

Currently I implemented workaround with 2 calls mixed. First is "db eval 
$query arr {...}" to collect list of result columns and second "set 
results [db eval $query]" to get all values.
It works, but it causes additional query execution. It's a workaround, 
not a solution.
Shouldn't it be fixed?

Regards,
Googie

_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to