PL/SQL 程序错误
PL/SQL procedure error
我是 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:`
好的,对不起,我想我的代码是正确的,我只是去重新加载我的数据库,神奇的事情就发生了。感谢大家的帮助!
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
我是 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:`
好的,对不起,我想我的代码是正确的,我只是去重新加载我的数据库,神奇的事情就发生了。感谢大家的帮助!
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