PL / SQL过程错误

时间:2015-04-15 01:48:23

标签: oracle stored-procedures plsql compiler-errors

我是PL / SQL的新手,我想知道为什么这个程序块会给我一个错误?

    declare 

    airFAA airport.faa_id%type;
    airUse airport.airport_use%type;
    airHours airport.attendance%type;

    procedure get_AirportHours( airFAA in airport.FAA_ID%type, airUse out airport.airport_use%type, airHours out airport.attendance%type) is

    BEGIN

    select airport_use, attendance
    into airuse, airhours
    from airport
    where faa_id = airfaa;

    End;

这是我的错误

    Error report:
    ORA-06550: line 16, column 4:
    PLS-00103: Encountered the symbol "end-of-file" when expecting one of the following:

    begin function package pragma procedure form
    06550. 00000 -  "line %s, column %s:\n%s"
    *Cause:    Usually a PL/SQL compilation error.
    *Action:`

1 个答案:

答案 0 :(得分:0)

好的对不起伙计,但我想我的代码是对的,我只是去重新加载我的数据库和神奇的事情发生了全部。感谢您的所有帮助!

declare 

airFAA airport.faa_id%type;
airUse airport.airport_use%type;
airHours airport.attendance%type;

procedure get_AirportHours( airFAA in airport.FAA_ID%type, airUse out airport.airport_use%type, airHours out airport.attendance%type) is

BEGIN

select airport_use, attendance
into airuse, airhours
from airport
where faa_id = airfaa;

end;
begin 
airFAA := 'LIT';
get_AirportHours( airFAA, airUse, airHours);
dbms_output.put_line( 'This airport is ' || airUse || ' and hours of operation are ' || airHours );

end; 

输出为

anonymous block completed
This airport is Open to the public and hours of operation are Continuous