日期:2014-05-17 浏览次数:20936 次
create table userinfo
(
userid number(10) primary key,
username nvarchar2(20) not null,
userpwd nvarchar2(20) not null,
usertitle nvarchar2(50),
usermes nvarchar2(100)
);
create table userMes
(
umid integer primary key,
userid number(10) references userinfo(userid),
umname nvarchar2(20)
);
--创建一个存储过程
create or replace procedure proc_createuserinfo
(
username in varchar2 default null,
userpwd in varchar2 default null,
usertitle in varchar2 default null,
usermes in varchar2 default null,
uusermes in varchar2 default null,
result out number
)
is
uuid number:=seq_uid.nextval;
begin
insert into userinfo(userid,username,userpwd,usertitle,usermes) values(uuid,username,userpwd,usertitle,usermes);
insert into usermes(umid,userid,umname) values(seq_mid.nextval,uuid,uusermes);
commit;
result:=sqlcode;;
end;