这是我写的存储过程:
create or replace procedure exec_result
( route_value IN NUMBER,
route_value OUT NUMBER)
as
rv INTEGER;
pt VAECHAR2;
rc VAECHAR2;
rv VAECHAR2;
rd VAECHAR2;
pno VAECHAR2;
pname VAECHAR2;
declare cursor log is select route_value,process_time,rsp_code,rsp_desc from log_interface_detail;
begin
for log1 in log loop
rv:=log1.route_value;
pt:=log1.process_time;
rc:=log1.rsp_code;
rd:=log1.rsp_desc;
end loop;
end;
declare cursor pro is select pro_no,pro_name from a_city_code;
begin
for pro1 in pro loop
pno:=pro1.pro_no;
pname:=pro1.pro_name;
end loop;
end;
citycode NUMBER;
begin
select route_value,process_time,rsp_code,rsp_desc into log
from log_interface_detail
where route_value=rv and process_time>='20090224000000';
select areano into citycode from GsmNumberBound
where beginnum<=rv and endnum>=rv;
select pro_no,pro_name into pro from a_city_code
where city_no=citycode;
dbms_output.put_line(rv);
dbms_output.put_line(pt);
dbms_output.put_line(rc);
dbms_output.put_line(rd);
dbms_output.put_line(pno);
dbms_output.put_line(pname);
end exec_result;
/
exec exec_result
编译出现如下错误:
Error(13,1): PLS-00103: 出现符号 "DECLARE"在需要下列之一时: begin function package pragma procedure subtype type use <an identifier> <a double-quoted delimited-identifier> form current cursor 符号 "begin" 被替换为 "DECLARE" 后继续。
Error(29,10): PLS-00103: 出现符号 "NUMBER"在需要下列之一时: := . ( @ % ; 符号 ":=" 被替换为 "NUMBER" 后继续。
Error(48): PLS-00103: 出现符号 "end-of-file"在需要下列之一时: begin case declare end exception exit for goto if loop mod null pragma raise return select update while with <an identifier> <a double-quoted delimited-identifier> <a bind variable> << close current delete fetch lock insert open rollback savepoint set sql execute commit forall merge <a single-quoted SQL string> pipe
不知道为什么…………