Ребят, подскажите, что не так???
------------------------------------------------------------------------------------------
create or replace procedure CHECK_NEW_ORDERS(order_id in integer) is
declare
cursor c1 is select * from reservations_orders where reservations_orders.id_orders=order_id;
cursor c2 is select * from guest_rooms g, hotels h where g.id_of_hotel=h.id_of_hotel;
begin
end CHECK_NEW_ORDERS;
------------------------------------------------------------------------------------------
Ошибка:
------------------------------------------------------------------------------------------
Ошибки компиляции PROCEDURE ADMIN4.CHECK_NEW_ORDERS
Ошибка: PLS-00103: Encountered the symbol "DECLARE" when expecting one of the following:
begin function package pragma procedure subtype type use
<an identifier> <a double-quoted delimited-identifier> form
current cursor external language
The symbol "begin" was substituted for "DECLARE" to continue.
Строка: 2
Текст: declare
Ошибка: PLS-00103: Encountered the symbol "END" when expecting one of the following:
begin case declare 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 pipe
Строка: 7
Текст: end CHECK_NEW_ORDERS;
------------------------------------------------------------------------------------------
Перенес объявление в блок бегин-энд:
------------------------------------------------------------------------------------------
create or replace procedure CHECK_NEW_ORDERS(order_id in integer) is
begin
declare
cursor c1 is select * from reservations_orders where reservations_orders.id_orders=order_id;
cursor c2 is select * from guest_rooms g, hotels h where g.id_of_hotel=h.id_of_hotel;
end CHECK_NEW_ORDERS;
------------------------------------------------------------------------------------------
, а ошибка:
------------------------------------------------------------------------------------------
Ошибка: PLS-00103: Encountered the symbol "END" when expecting one of the following:
begin case declare 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 pipe
Строка: 7
Текст: end CHECK_NEW_ORDERS;
-----------------------------------------------------------------------------------------
остается. Да и вообще переносить помоему нельзя, попробывал перенести после попытки перевода первой ошибки. Скажите почему при компиляции даже пустой процедуры возникает эта ошибка, да и вообще - где объявить курсоры??
Всем большое спасибо.