N
necyhk
Unregistered / Unconfirmed
GUEST, unregistred user!
我创建了一个表<br>Create table hr.emp<br>(<br> ID varchar2(10) constraint EMP_PK primary key ,<br> MemberNO varchar(20) not null,<br> MemName varchar(20) not null<br>)<br><br>对这个表我写了一个存储过程,用于插入与修改表记录,<br>create or replace procedure hr.SP_EMP_UPDATE<br>( pID in varchar default null,<br> pMemberNO in varchar default null,<br> pMemName in varchar default null<br>)<br>is<br> pCount int;<br>begin<br> select count(*) into pCount from hr.emp where ID=pID;<br> if pCount = 0 then<br> insert into hr.emp values(pid,pMemberNo,pMemName);<br> else<br> update hr.emp set MemberNO=pMemberNO,MemName=pMemName<br> where ID=pID;<br> end if;<br>end;<br><br>--------------------------------------<br>-- Created on 2007-4-16 by JUNY <br>declare <br> -- Local variables here<br> i integer;<br>begin<br> -- Test statements here<br> hr.sp_emp_update('2','00000','Jack');<br>end;<br><br>在此调用,可是数据并没有插入到数据库去,这是为什么呀