I have a question on porting dynamic queries. I've read the docs on
the db_map command, but it's not clear to me what should I do in cases
like this (I abbreviated the query, since the original is huge):
set query "
select
attributes.attribute_id, attribute_name,
attributes.table_name,
attribute_label, type_label, object_type as subtype, datatype,
params.is_html, params.is_required,
..."
if { ![template::util::is_nil extra_where] } {
append query "
and
$extra_where"
}
append query "
order by
attributes.tree_level, attributes.sort_order desc,
attributes.attribute_id, params.param_id"
if { ![template::util::is_nil extra_orderby] } {
append query ", $extra_orderby"
}
uplevel "
template::query $datasource_name $datasource_type {$query}
"
My question is regarding the two conditional statements that may or may not go in the query. What should I do about them in the .xql files?
Request notifications