Yes, that's right. it returns a set of output variables.
I'm not suggesting to change that. My suggestion is in case of no results were returned in the recordset. Then instead a throwing errors, a null array or a simple null value must be returned.
One would avoid to use [catch {...} errmsg] all the time db_1row is used.
Does it make sense?
p.s. I'm curious to understand 100% of your last post!!
but your code didn't run. It returned error.
ERROR:
wrong # args: should be "lmap list proc_name"
while executing
"lmap s [db_list_of_ns_sets _ {
select * from acs_objects limit 5
}] {ns_set array $s}"
("uplevel" body line 1)
invoked from within
"uplevel 1 [string map {"\\\r\n" " "} $script]"
I amended it, chaging _ to get_obj and added square brackets to {ns_set array $s} as in
I. wiithin curly braquets {}, ns_set command is not recognized.
set db_list_of_dicts [lmap s [db_list_of_ns_sets get_objs {
select * from acs_objects limit 5
}] [{ns_set array $s}]]]
ERROR:
invalid command name "ns_set array $s"
while executing
"{ns_set array $s}"
("uplevel" body line 3)
invoked from within
"uplevel 1 [string map {"\\\r\n" " "} $script]"
II. and if I remove curly braquets {}, I get another error.
set db_list_of_dicts [lmap s [db_list_of_ns_sets get_objs {
select * from acs_objects limit 5
}] [ns_set array $s]]]
ERROR:
can't read "s": no such variable
while executing
"ns_set array $s"
("uplevel" body line 4)
invoked from within
"uplevel 1 [string map {"\\\r\n" " "} $script]"