日期:2014-05-17 浏览次数:21306 次
create or replace function insert_doctorInfo(account in varchar2, password in varchar2, empid in varchar2, empname in varchar2,
sexcode in number, born in varchar2, nation in number, departid in number, isout in varchar2, operdate in varchar2, memo in varchar2, response in number, position in number, education in number, specialty in number, hospital in number, oldexpert in varchar2)
return number is
begin
declare ret number;
account_num number;
begin
select count(*) into account_num from ts_user --判断账户是否重复
where account in
(
select account from ts_user
);
if
account_num = 0
then
ret :=0; --账户未重复,则进行插入操作
insert into ts_user(id,account,password,empinfoid)
values(seq_ts_user_tbe_empinfo.nextval,account,password,seq_ts_user_tbe_empinfo.currval)
insert into tbe_empinfo(id,empid,empname,sexcode,born,nation,departid,isout,operdate,memo,response,position,education,specialty,hospital,oldexpert)
values(seq_ts_user_tbe_empinfo.currval,empid,empname,sexcode,born,nation,departid,isout,
(select sysdate from dual),memo,response,position,education,specialty,hospital,oldexpert)
insert into tbe_empdepart(id,empinfoid,userid,departid)
values(seq_tbe_empdepart.nextval,seq_ts_user_tbe_empinfo.currval,seq_ts_user_tbe_empinfo.currval,departid)
else