IS
l_rate NUMBER
BEGIN
BEGIN
SELECT dname, loc
INTO p_dname, p_loc
FROM scott.dept
WHERE deptno = p_deptno
EXCEPTION
WHEN NO_DATA_FOUND
THEN
p_dname := NULL
p_loc := NULL
DBMS_OUTPUT.put_line ('该部门不存在')
END
CASE
WHEN p_deptno = '10'
THEN
l_rate := 0.1
WHEN p_deptno = '20'
THEN
l_rate := 0.08
WHEN p_deptno = '30'
THEN
l_rate := 0.05
ELSE
l_rate := 0.03
END CASE
UPDATE scott.emp
SET sal = sal * l_rate
WHERE deptno = p_deptno
END
declarev_count number := 1
v_sumnumber := 0
begin
for v_count in 1..100
loop
if mod(v_count,2) = 0 then
v_sum := v_sum + v_count
end if
end loop
dbms_output.put_line(v_sum)
end
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)