以下代码运行没有问题:
prepare_query(QueryFile, Q_Name, Statement) :-
load_structure(QueryFile, QueryXML, [dialect(xml), space(remove)]),
getDNS( QueryXML, Q_Name, DNS),
getSelect(QueryXML, Q_Name, Select),
getParameter(QueryXML, Q_Name, Parameters),
=> getResultNames(QueryXML, Q_Name, ResultNames),
odbc_prepare(DNS, Select, Parameters, Statement,
[ findall((Apl_id_n, Apl_id_b), row(Apl_id_n, Apl_id_b)) ]).
谓词getResultNames
返回原子 Apl_id_n, Apl_id_b
,所以我理解为什么以下代码
FindAllOption =.. [findall,(ResultNames),row(ResultNames)],
writeln(FindAllOption)
返回:
findall(Apl_id_n, Apl_id_b,row(Apl_id_n, Apl_id_b))
是否可以在分隔的字词中拆分ResultNames
,以便将FindAllOption
创建为:
findall((Apl_id_n, Apl_id_b),row(Apl_id_n, Apl_id_b))
还有另一种方法可以让findall-option
更灵活吗?
本