create or replace procedure personWithGivenCity(city1 in varchar) as
cursor c1 is select p.name
from person p
join address ad
on p.name=ad.name
where ad.city=city1;
c c1%rowtype;
begin
open c1;
loop
fetch c1 into c;
exit when c1%notfound;
dbms_output.put_line(c.name);
end loop;
close c1;
end;
/
-- Block which class the procedure
declare
city varchar2(10):='Vasco';
begin
personWithGivenCity(city);
end;
/
Запрос работает без блока. Но я получаю end-of-file
ошибку на line 3 column 11
.
Структура таблицы
лицо
name varchar2(10) primary key,
gender varchar2(10),
age number
Адрес
name varchar2(10) references person(name),
hno number,
laneno number,
city varchar2(10),
state varchar2(10)
Ошибка
ORA-06550: line 3, column 11: PLS-00103: Encountered the symbol "end-of-file" when expecting one of the following: . ( % ; for