oracle考试
发布网友
发布时间:2022-03-30 08:56
我来回答
共3个回答
热心网友
时间:2022-03-30 10:25
1. create table emp_info as
as select * from t_employee;
2. create or replace procere Avg_Sal(emp_no varchar2)
is
AvgSal number;
begin
select avg(f_salary) into AvgSal from t_employee
where f_dno=(select f_dno from t_employee where f_empno = empno);
dbms_output.put_line('the avg of that dept is'||AvgSal);
exception
when no_data_found then
dbms_output.put_line('-1');
end;
调试代码:set serveroutput on;
exec Avg_Sal('一个员工编号');
你说的题目有点不太明白 一个过程之中怎么用函数!? 过程怎么返回一个数呀?我没有用过...
热心网友
时间:2022-03-30 11:43
1)
create table emp_info
as
select * from t_employee order by age;
2)
create procere p1
(
p_f_empno t_employee.f_empno%type,
p_pjxs number(10,2)
)
as
begin
select avg(f_salary) into p_pjxs from t_employee where f_empno=p_f_empno;
end;
热心网友
时间:2022-03-30 13:18
...