預存程序PLS-00103

來源:互聯網
上載者:User

這是我寫的預存程序:

 

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

 

不知道為什麼…………

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.