Re: Wie geht das eigentlich mit den "CONTINUE HANDLER"...
> Kann man eigentlich einen Befehl "CONTINUE HANDLER"
> auf einen bestimmten Cursor setzen,
Nein.
> und kann man mehrere CONTINUE HANDLERs gleichzeitig
> jeweils auf verschiedene Cursor setzen die nur auf denjenigen dann reagieren?
Fast.
> Wenn ja, wie?
delimiter //
drop procedure p//
drop table t1//
drop table t2//
create table t1 (s1 int)//
create table t2 (s1 int)//
insert into t1 values (1),(2),(3)//
insert into t2 values (4),(5),(6)//
create procedure p ()
begin
declare c1 cursor for select * from t1;
declare c2 cursor for select * from t2;
begin
declare v1 int;
declare v2 int;
declare v3 int default 0;
open c1;
open c2;
while v3 <> 5 do
begin
declare continue handler for not found select 'c1 not found';
fetch c1 into v1;
end;
begin
declare continue handler for not found select 'c2 not found';
fetch c2 into v2;
end;
set v3 = v3 + 1;
end while;
end;
end//
call p()//
Alles ist mehr einfach mit RESIGNAL, aber RESIGNAL ist nur
in Version 5.5.
Peter Gulutzan
Sun / MySQL
Subject
Views
Written By
Posted
2091
February 09, 2010 06:59AM
Re: Wie geht das eigentlich mit den "CONTINUE HANDLER"...
1790
February 21, 2010 11:12AM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.