日期:2014-05-17 浏览次数:20887 次
Create or Replace Procedure insertStu1 (sid in char, sname in char, sex in char) as begin --select sid into stuid from dual; insert into students(sutid,stuname,stusex) values(sid,sname,sex); end insertStu1;
Create or Replace Procedure insertStu (sid in char, sname in char, sex in char,stuid out char) as begin select sid into stuid from dual; insert into students(sutid,stuname,stusex) values(sid,sname,sex); end insertStu;
exec insertStu1('10210405513','judy.K','female');--执行无返回值的没有错误 --执行有返回值的出错 set serveroutput on DECLARE sPrint varchar2(100); begin exec insertStu('10210405512','judy.D','female',sPrint); end select sPrint from dual; --错误如下: exec insertStu('10210405512','judy.D','female',sPrint); * 第 3 行出现错误: ORA-06550: 第 3 行, 第 6 列: PLS-00103: 出现符号 "INSERTSTU"在需要下列之一时: := . ( @ % ; 符号 ":=" 被替换为 "INSERTSTU" 后继续。 ORA-06550: 第 5 行, 第 1 列: PLS-00103: 出现符号 "SELECT"在需要下列之一时: ; <an identifier> <a double-quoted delimited-identifier>