最新回答 / 慕仰9027661
scope=spfile 仅仅更改spfile里面的记载,不更改内存,也就是不立即生效,而是等下次数据库启动生效。有一些参数只允许用这种方法更改scope=memory 仅仅更改内存,不改spfile。也就是下次启动就失效了 scope=both 内存和spfile都更改不指定scope参数,等同于scope=both.
2017-06-07
loop
fetch emp_cursor into cempno,csal ;
exit when (totalSal + csal*0.1) > 50000 or emp_cursor%notfound;
update emp set sal=sal*1.1 where empno=cempno;
countsum:=countsum+1;
totalsal:=totalsal+csal*0.1;
end loop;
fetch emp_cursor into cempno,csal ;
exit when (totalSal + csal*0.1) > 50000 or emp_cursor%notfound;
update emp set sal=sal*1.1 where empno=cempno;
countsum:=countsum+1;
totalsal:=totalsal+csal*0.1;
end loop;
2017-06-06
loop
exit when (totalSal + psal*0.1) > 50000;
fetch emp_cursor into cempno,csal ;
exit when emp_cursor%notfound;
update emp set sal=sal*1.1 where empno=cempno;
countsum:=countsum+1;
totalsal:=totalsal+csal*0.1;
end loop;
exit when (totalSal + psal*0.1) > 50000;
fetch emp_cursor into cempno,csal ;
exit when emp_cursor%notfound;
update emp set sal=sal*1.1 where empno=cempno;
countsum:=countsum+1;
totalsal:=totalsal+csal*0.1;
end loop;
2017-06-06
set serveroutput on
declare
cursor cemp(dno number) is select ename from emp where empno=dno;
pename emp.ename%type;
begin
open cemp(10);
LOOP
fetch cemp into pename;
exit when cemp%notfound;
dbms_output.put_line(pename);
end loop;
close cemp;
end;
/
为啥我没有结果
declare
cursor cemp(dno number) is select ename from emp where empno=dno;
pename emp.ename%type;
begin
open cemp(10);
LOOP
fetch cemp into pename;
exit when cemp%notfound;
dbms_output.put_line(pename);
end loop;
close cemp;
end;
/
为啥我没有结果
2017-06-01
代码段三:
close emp_cursor;
dbms_output.put_line('涨工资人数 工资总额');
dbms_output.put_line(rpad(countsum,8,' ')||' '||rpad(totalsal,8,' '));
end;
close emp_cursor;
dbms_output.put_line('涨工资人数 工资总额');
dbms_output.put_line(rpad(countsum,8,' ')||' '||rpad(totalsal,8,' '));
end;
2017-05-28
代码段二:
loop
exit when totalsal>50000;
fetch emp_cursor into cempno,csal ;
exit when emp_cursor%notfound;
if totalsal+csal*0.1<=50000 then --这一句很关键,如果没有这个判断的话,总工资可能会超过5万。
update emp set sal=sal*1.1 where empno=cempno;
countsum:=countsum+1;
totalsal:=totalsal+csal*0.1;
end if;
end loop;
commit;
loop
exit when totalsal>50000;
fetch emp_cursor into cempno,csal ;
exit when emp_cursor%notfound;
if totalsal+csal*0.1<=50000 then --这一句很关键,如果没有这个判断的话,总工资可能会超过5万。
update emp set sal=sal*1.1 where empno=cempno;
countsum:=countsum+1;
totalsal:=totalsal+csal*0.1;
end if;
end loop;
commit;
2017-05-28