--
-- ### Procedure format check
-- 
-- 
--

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

drop if exists table t2;
create table t2 ( a int, b int );

drop if exists procedure formatCheck;
@
create procedure formatCheck ( a in string(30), b in int ) 
begin 

   var c int;

   :c = ( select a from t1 where a > 24 and b in ( select b from t2 ) );

   while :c < 10
   begin
      if :c = 1
      then
         :c = :c + 1;
      else
         :c = :c + 2;
	 if :a = 4
	 then
	    :c = :c + 1;
	 else
	    :c = :c + 2;
	 end;
      end;
      insert into t1 values ( 1, 2 );
      delete from t1  txxxxxxxxxx where a in ( select a from t2 );
   end;
end;
@

show procedure formatCheck;
