create or replace procedure UpdateDemarcateFileIsActive
declarations IDNum in varchar2,
declarations Name in varchar2
as
begin
update demarcatefile set isactive='0' where name=Name
update demarcatefile set isactive='1' where id=IDNum
end;
警告:创建的存储过程带有编译错误.
该存储过程该怎么写呢?
还有执行的时候该怎么执行?
还请各位同仁多多指教.非常感谢.
------解决方案--------------------
- SQL code
CREATE OR REPLACE PROCEDURE UPDATEDEMARCATEFILEISACTIVE(NAMEX IN VARCHAR2, IDNUM IN VARCHAR2) ISBEGIN UPDATE DEMARCATEFILE SET ISACTIVE = '0' WHERE NAME = NAMEX; UPDATE DEMARCATEFILE SET ISACTIVE = '1' WHERE ID = IDNUM;END;/调用方法:BEGIN UPDATEDEMARCATEFILEISACTIVE('abc', '123');END;/
------解决方案--------------------
Why not commit it? try it ..
- SQL code
create or replace procedure UpdateDemarcateFileIsActive (IDNum in varchar2, Name_in in varchar2)as begin update demarcatefile set isactive='0' where name=Name_in; update demarcatefile set isactive='1' where id=IDNum;commit;end;
------解决方案--------------------
不知道你写这个declarations是干什么用的..
改成下面看看..
- SQL code
create or replace procedure UpdateDemarcateFileIsActive(IDNum in varchar2, Name in varchar2) isbegin update demarcatefile set isactive = '0' where name = Name; update demarcatefile set isactive = '1' where id = IDNum; commit;end;
代码迷推荐解决方案:oracle存储过程,http://www.daimami.com/search?q=177537