你这么改试试create or replace procedure stuprocess(
tempp in stu.p%type,
tempe in stu.e%type,
tempm1 in stu.m1%type,
tempm2 in stu.m2%type,
tempm3 in stu.m3%type,
tempsum in result.sum%type)assturecord stu%rowtype;
stusum result.sum%type;
stuflag varchar2(4);
cursor stucursor is select * from stu;errmessage exception;begin
open stucursor;
loop
fetch stucursor into sturecord;
if stucursor%notfound then
raise errmessage;
endif;
stusum:=sturecord.e+sturecord.p+sturecord.m1+sturecord.m2+sturecord.m3
if (sturecord.e>=tempe and
sturecord.p>=tempp and
sturecord.m1>=tempm1 and
sturecord.m2>=tempm2 and
sturecord.m3>=tempm3 and
stusum>=tempsum) then
stuflag:="录取";
else
stuflag:="落选";
endif;
exit when stucursor%notfound;
insert into result values(sturecord.bh,sturecord.xm,sturecord.lb,sturecord.e,sturecord.p,sturecord.m1,sturecord.m2,sturecord.m3,stusum,stuflag);
end loop;
close stucursor;
commit;
exception when errmessage then
dbms_output.putline("can not open the table");end;
tempp in stu.p%type,
tempe in stu.e%type,
tempm1 in stu.m1%type,
tempm2 in stu.m2%type,
tempm3 in stu.m3%type,
tempsum in result.sum%type)assturecord stu%rowtype;
stusum result.sum%type;
stuflag varchar2(4);
cursor stucursor is select * from stu;errmessage exception;begin
open stucursor;
loop
fetch stucursor into sturecord;
if stucursor%notfound then
raise errmessage;
endif;
stusum:=sturecord.e+sturecord.p+sturecord.m1+sturecord.m2+sturecord.m3
if (sturecord.e>=tempe and
sturecord.p>=tempp and
sturecord.m1>=tempm1 and
sturecord.m2>=tempm2 and
sturecord.m3>=tempm3 and
stusum>=tempsum) then
stuflag:="录取";
else
stuflag:="落选";
endif;
exit when stucursor%notfound;
insert into result values(sturecord.bh,sturecord.xm,sturecord.lb,sturecord.e,sturecord.p,sturecord.m1,sturecord.m2,sturecord.m3,stusum,stuflag);
end loop;
close stucursor;
commit;
exception when errmessage then
dbms_output.putline("can not open the table");end;
解决方案 »
- oracle 查询两个字段值相同的记录
- Oracle 11G 安装时要要一个客户标识码,这个怎么解决?
- 请教一个和clob有关的查询语句
- 怎样求两个datetime类型之间的时间差(分钟)?
- R11i系統報表,'FND FLEXSQL '等等是什麼東東?
- oracle那个版本后,不再支持Procedure里面creat语句?
- 如何消除OEM中ORA-28000: the account is locked 的提示?
- 如何用SQL检索出一个DataBase里面所有的用户
- Oracle8.1.6服务状态为“启动”,数据库进不去怎样解决
- 请问怎样让oracle自动销毁没用了的proccess?
- 大伙救命啊!寻找ORACLE数据库的LINUX版本,当然指得是CD版了
- 以回车符结束的fields terminated by X'09' 语句怎么写?我的表只有一个字段,想从一个txt文件导入数据
tempp in stu.p%type,
tempe in stu.e%type,
tempm1 in stu.m1%type,
tempm2 in stu.m2%type,
tempm3 in stu.m3%type,
tempsum in result.sum%type)
as
sturecord stu%rowtype;
stusum result.sum%type;
stuflag varchar2(4);
cursor stucursor is select * from stu;begin
open stucursor;
loop
fetch stucursor into sturecord;
exit when stucursor%notfound;
stusum:=sturecord.e+sturecord.p+sturecord.m1+sturecord.m2+sturecord.m3
if (sturecord.e>=tempe) and
(sturecord.p>=tempp) and
(sturecord.m1>=tempm1) and
(sturecord.m2>=tempm2) and
(sturecord.m3>=tempm3) and
(stusum>=tempsum) then
stuflag:="录取";
else
stuflag:="落选";
end if;
insert into result values(sturecord.bh,sturecord.xm,sturecord.lb,sturecord.e,sturecord.p,sturecord.m1,sturecord.m2,sturecord.m3,stusum,stuflag);
end loop;
close stucursor;
commit;
exception
when others then
dbms_output.putline("can not open the table");end;
把传入变量写在括号里,as 你的变量.
create or replace procedure proc
(
vari1 char(6),
vari2 number(12)
)
as
yourvari1 char(6);
yourvari number(12);
......
......
......