--
-- ### Table curser value update
-- 
-- 
--

drop if exists table t1;
create table t1 ( a int, b string(30));

drop if exists table t2;
create table t2 ( a int, b string(30));
create btree b2 on t2(a);

insert into t1 values ( 1, 'XXX');
insert into t1 values ( 2, 'YYY');
insert into t1 values ( 3, 'YYY');
insert into t1 values ( 4, 'YYY');

insert into t2 values ( 1, 'XXX');
insert into t2 values ( 2, 'YYY');
insert into t2 values ( 3, 'XXX');
insert into t2 values ( 4, 'YYY');


drop if exists procedure tproc;
@
create procedure tproc ( x in int )
begin
   delete from t1 where b in ( select b from t2 where a = :x );
end;
@

call tproc(2);
call tproc(3);





