1.简单的helloworld
create or replace procedure helloworld as
begin
dbms_output.put_line('hello world!');
end helloworld;
set serveroutput on;
exec helloworld;
2.简单的向scott的emp表中插入一条数据
create or replace procedure insertemp
as
begin
insert into scott.emp values(1002,'wang','CLERK',7369,to_date('1985-10-15','YYYY-MM-DD'),5000,3000,10);
end insertemp;
exec insertemp;
3.简单的向dept表中插入数据
create procedure insert_dept(no1 number,name1 varchar2,loc1 varchar2)
is
begin
insert into dept(deptno,dname,loc) values(no1,name1,loc1);
end;
exec insert_dept(50,'SALES','BeiJing');