–显示控制台字符
set serveroutput on;
–执行
execute (exec) + 名称(…);
–一存储过程
create or replace procedure p_hello
is
begin
dbms_output.put_line(‘你好’);
end;
/
二
declare
v_name varchar2(20);
v_sal number(8);
begin
select name,sal into v_name,v_sal from emp where empno=&abc;
dbms_output.put_line(‘姓名:’||c_name||’工资:’||v_sal);
exception
when NO_DATA_FOUND THEN
dbms_output.put_line(‘请输入正确的学号’);
end;
/
三根据输入员工的姓名来修改工资
create or replace procedure p_updateSalByname(v_ename in varchar2,v_sal in number)
is
begin
update emp set sal=v_sal where ename=v_ename;
end;
/