use test;
delimiter /
drop table if exists "oecettest"
/
CREATE TABLE "oecettest" (
  "etsoecet" varchar(6) COLLATE utf8_bin NOT NULL,
  "easoecet" varchar(6) COLLATE utf8_bin NOT NULL,
  "chmoecet" varchar(4) COLLATE utf8_bin NOT NULL,
  UNIQUE KEY "oecet_ets" ("etsoecet","chmoecet","easoecet")
)
/
drop procedure if exists pssgnumnew
/
CREATE OR REPLACE PROCEDURE pssgnumnew()
  IS
BEGIN
   if 1=2 THEN
      BEGIN
         DECLARE
             CURSOR sel_oecet IS
                    SELECT easoecet
                      FROM oecettest ;
         BEGIN
            goto iac_err;
         END;
      END;
   END IF;
   if 1=1 THEN
      GOTO iac_err;
   END IF;
   << iac_err >>
   RETURN ;
END;
/
call pssgnumnew()
/
