出现commandtext does not return a result set
这个select肯定是正确的,已在sqlplus中通过。
我在adoquery的sql属性中写的select,把active设置为true,就出错。
adoquery 是否可以执行union 操作。
急,查过以前的贴子,也没找到办法。
...全文
14818打赏收藏
在adoquery中用union all联合2个select句子,出错!
出现commandtext does not return a result set 这个select肯定是正确的,已在sqlplus中通过。 我在adoquery的sql属性中写的select,把active设置为true,就出错。 adoquery 是否可以执行union 操作。 急,查过以前的贴子,也没找到办法。
这样可以不?
select * from (
(select t.decl_no,t.process_id ,t.next_flow_node ,t.x_cert_style_code ,'N' type from xc_proc_active t where t.flow_end_flag='N' and t.next_flow_node='0501' and t.x_cert_style_code='253')
union all
(select t.decl_no ,t.process_id ,t.next_flow_node ,t.x_cert_style_code ,c.print_ver type from xc_proc_active t,t_cert_use c where t.flow_end_flag='N' and (t.next_flow_node='0504' or t.next_flow_node='0505' or t.next_flow_node='0506') and t.x_cert_style_code='253' and t.decl_no=c.print_decl_no and c.print_ver='TT')
) as tempTable
代码如下:
(select t.decl_no,t.process_id ,t.next_flow_node ,t.x_cert_style_code ,'N' type from xc_proc_active t where t.flow_end_flag='N' and t.next_flow_node='0501' and t.x_cert_style_code='253')
union all
(select t.decl_no ,t.process_id ,t.next_flow_node ,t.x_cert_style_code ,c.print_ver type from xc_proc_active t,t_cert_use c where t.flow_end_flag='N' and (t.next_flow_node='0504' or t.next_flow_node='0505' or t.next_flow_node='0506') and t.x_cert_style_code='253' and t.decl_no=c.print_decl_no and c.print_ver='TT')