if 0<=usal<1000 then 不能直接这样写的,改成这样 if usal<1000 and usal>=0 then
declare usal number(8,2); begin select sal into usal from T1 where empno=&empno; if 0<=usal and usal<1000 then dbms_output.put_line('满足条件1'); update T1 set sal=usal+200 where empno=&empno; elsif 1000<=usal and usal<1500 then dbms_output.put_line('满足条件2'); update T1 set sal=usal+200 where empno=&empno; elsif 1500<=usal and usal<2000 then dbms_output.put_line('满足条件3'); update T1 set sal=usal+200 where empno=&empno; end if; end; 知道错误在哪两个地方了吧
不能直接这样写的,改成这样
if usal<1000 and usal>=0 then
usal number(8,2);
begin
select sal into usal from T1 where empno=&empno;
if 0<=usal and usal<1000 then
dbms_output.put_line('满足条件1');
update T1 set sal=usal+200 where empno=&empno;
elsif 1000<=usal and usal<1500 then
dbms_output.put_line('满足条件2');
update T1 set sal=usal+200 where empno=&empno;
elsif 1500<=usal and usal<2000 then
dbms_output.put_line('满足条件3');
update T1 set sal=usal+200 where empno=&empno;
end if;
end; 知道错误在哪两个地方了吧