1、带参数的存储过程
CREATE
OR REPLACE PROCEDURE sp_pro2 (spname VARCHAR2, newsal NUMBER) IS
BEGIN
UPDATE
emp SET sal = newsal WHERE ename=spname;
END;
--参数VARCHAR2不需要指定大小
exec
sp_pro2(‘SMITH‘,10);
或者call
sp_pro2(‘SMITH‘,10);
时间: 2024-10-13 17:00:13
1、带参数的存储过程
CREATE
OR REPLACE PROCEDURE sp_pro2 (spname VARCHAR2, newsal NUMBER) IS
BEGIN
UPDATE
emp SET sal = newsal WHERE ename=spname;
END;
--参数VARCHAR2不需要指定大小
exec
sp_pro2(‘SMITH‘,10);
或者call
sp_pro2(‘SMITH‘,10);