初学存储过程
CREATE OR REPLACE PROCEDURE insert_student(
sno1 student.sno%TYPE,
sname1 student.sname%type,
ssex1 student.ssex%type,
sbirthday1 student.sbirthday%type,
classno1 student.classno%TYPE)
as
begin
INSERT INTO student(sno,sname,ssex,sbirthday,classno) VALUES(sno1,sname1,ssex1,sbirthday1,classno1);
end insert_student;
exec insert_student('20001144','吕图','男',TO_DATE('2001-4-12','4个Y-MM-DD'),'2006');//不让输4个Y
各种
只有在命令行里才能用exec命令来执行存储过程,在sql窗口中一般都是用下面这种方式来执行的
begin
存储过程名称(参数1,参数2);
end;
/