📄 陈平新.txt
字号:
第一题:
/*
create or replace function mysum (n int)
return int
is
i int;
sumb int :=0;
P_number exception;
begin
if n<0 then
raise P_number;
end if;
for i in 1..n loop
sumb := sumb+i;
end loop;
return sumb;
exception
when P_number then
dbms_output.put_line('shu ru shu <0');
return 0;
end;
*/
declare
n int;
aa int;
begin
n:=&uuu;
aa:=mysum(n);
dbms_output.put_line(aa);
end;
2.1
create or replace function salay(em_no int)
return int
is
bb number(10);
begin
select sal into bb from emp where empno=em_no;
return bb;
exception
when no_data_found then
dbms_output.put_line('雇员号不存在,请重新输入');
commit;
end;
2.2
create or replace procedure new_emp (em_no int,em_sal int)
is
begin
update emp set sal=em_sal where empno=em_no;
end;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -