关于达梦8管理工具执行多行sql语法错误问题

if not exists(select 1 from WAP_CONFIG2.AUTH_APP where 1=0) THEN
 select * from WAP_CONFIG2.AUTH_APP where 1=1;
 ELSE
 select * from WAP_CONFIG2.AUTH_APP where 1=1;
 END IF;

 

如上sql在达梦8管理工具会报语法错误,以上可以通过 begin  end;解决

begin
if not exists(select 1 from WAP_CONFIG2.AUTH_APP where 1=0) THEN
 select * from WAP_CONFIG2.AUTH_APP where 1=1;
 ELSE
 select * from WAP_CONFIG2.AUTH_APP where 1=1;
 END IF;
end;

 

posted @ 2024-04-17 16:22  山顶洞外人  阅读(143)  评论(0编辑  收藏  举报