接触Oracle没多久,问个if语句的问题
比如:
declare
bb varchar2(64);
begin
if 1=2 then
select xx into bb from pub_table;
update pub_table set xx ='1'
end if;
end;
问:then之后有两个执行语句一个赋值,一个修改。两者之间没什么关系,我是随便写的。
但问题是,这样写好像通不过,if下面只能跟一个的么?因为 我如果写成:
declare
bb varchar2(64);
begin
if 1=2 then
begin
select xx into bb from pub_table;
update pub_table set xx ='1'
end;
end if;
end;
好像也通不过。有谁知道有什么办法解么?Oracle和sql这个差异有点弄不懂了。谢谢了各位