3,499
社区成员
发帖
与我相关
我的任务
分享declare
-- Local variables here
i integer;
begin
if i-1300<0 then
dbms_output.put_line('no');
return;
end if;
for item in (select * from 表) loop
if item.上限-i>=0 then
dbms_output.put_line('按这个标准交');
return;
end if;
end loop;
end;
--大概就是这个样子,自已改下就可以了
create or replace procedure p_t(p_sal number)
as
v_shangxian number;
v_xiaxian number;
v_kouchushu number;
v_tax number;
begin
execute immediate 'select 工资下限,工资上限,扣除数,税率 from 你的表 where :1 between 工资下限 and 工资上限'
into v_shangxian,v_xiaxian,v_kouchushu,v_tax
using p_sal;
dbms_output.put_line(v_shangxian);
end;
/