例子1 编写一个过程,该过程向某表中添加一条记录。
CREATE OR REPLACE PROCEDURE jl_pro IS
BEGIN
INSERT INTO mytest ('user1','pass1');
END;
exec jl_pro
例子2 删除一条记录
create or replace procedure jl_pro2 IS
BEGIN
--执行部分
DELETE FROM mytest WHERE NAME='user1';
END;
例子3 编写一个过程,根据名字,修改工资
CREATE OR REPLACE PROCEDURE jl_pro3(myname varchar2,newsal NUMBER) IS
BEGIN
UPDATE emp SET sal=newsal WHERE ename=myname;
COMMIT;
END;
CREATE OR REPLACE PROCEDURE jl_pro IS
BEGIN
INSERT INTO mytest ('user1','pass1');
END;
exec jl_pro
例子2 删除一条记录
create or replace procedure jl_pro2 IS
BEGIN
--执行部分
DELETE FROM mytest WHERE NAME='user1';
END;
例子3 编写一个过程,根据名字,修改工资
CREATE OR REPLACE PROCEDURE jl_pro3(myname varchar2,newsal NUMBER) IS
BEGIN
UPDATE emp SET sal=newsal WHERE ename=myname;
COMMIT;
END;