create or replace procedure query
(eno in numbr,
pename out varchar2,
psal out number,
pjob out varchar2
)
as
begin
select ename,sal,empjob into pename,psal,pjob from emp where mpno=eno;
end
(eno in numbr,
pename out varchar2,
psal out number,
pjob out varchar2
)
as
begin
select ename,sal,empjob into pename,psal,pjob from emp where mpno=eno;
end
2016-12-05
create or replace function queryempincom(eno in numbr)
as
--定义变量保存员工的薪水和奖金
psal emp.sal%type;
pcomm emp.comm%type;
begin
select sal,comm into pasl,pcomm from emp where empno=eno;
return psal*12+pcomm;
end;
as
--定义变量保存员工的薪水和奖金
psal emp.sal%type;
pcomm emp.comm%type;
begin
select sal,comm into pasl,pcomm from emp where empno=eno;
return psal*12+pcomm;
end;
2016-12-05
不带参数的存储过程
创建存储过程
create or replace procedure myprocsayhelloworld
as
--说明部分
begin
dbms_output.put_line('Hello world');
end;
--调用存储过程
1. exec myprocsayhelloworld();
2.begin
myprocsayhelloworld();
myprocsayhelloworld();
end;
创建存储过程
create or replace procedure myprocsayhelloworld
as
--说明部分
begin
dbms_output.put_line('Hello world');
end;
--调用存储过程
1. exec myprocsayhelloworld();
2.begin
myprocsayhelloworld();
myprocsayhelloworld();
end;
2016-12-05
最新回答 / 歪头娃娃
全局变量声明VARIABLE <变量名> 类型;示例: VARIABLE
num number;使用全局变量:<变量名>示例: :num:=100;i=:num;
2016-11-28