UPDATE OR INSERT INTO TBMENU (CONTROLE, GRUPO, SUBGRUPO, TIPO, URL, DESCRICAO, DATAHORA)
                      VALUES (11810, 'ADM', 'ADM', '1   ', '', 'CONFIGURAÇÕES DE TELEGRAM', '2021-05-28 14:07:21')
                    MATCHING (CONTROLE, GRUPO);
UPDATE OR INSERT INTO TBMENU (CONTROLE, GRUPO, SUBGRUPO, TIPO, URL, DESCRICAO, DATAHORA)
                      VALUES (11820, 'ADM', 'ADM', '1   ', '', 'CADASTRO DE API''S', '2021-06-03 09:45:25')
                    MATCHING (CONTROLE, GRUPO);
					
					
SET TERM ^ ;

CREATE OR ALTER procedure SPU_CLIENTE_BLOQ_DESBLOQ
as
declare variable TIPO varchar(100);
Begin
         IN AUTONOMOUS TRANSACTION
         DO BEGIN
            for
                select TIPO from SPU_CLIENTE_BLOQUEIOS
            into
            TIPO
            do begin

            end
         END

         IN AUTONOMOUS TRANSACTION
         DO BEGIN
            for
               select TIPO from SPU_CLIENTE_DESBLOQUEIOS
            into
            TIPO
            do begin

            end
         END
End
^

SET TERM ; ^


SET TERM ^ ;

CREATE OR ALTER procedure SP_ZERAR_GENERATOR
as
declare variable GENERATOR_NAME varchar(200);
declare variable POS integer;
begin

  for
    select                                                
        RDB$GENERATOR_NAME
    from RDB$GENERATORS
  into
    :GENERATOR_NAME
  do begin

    in autonomous transaction do
    begin

        POS = 0;

        execute statement 'ALTER SEQUENCE '||:GENERATOR_NAME||' RESTART WITH '||coalesce(:POS,0)||' INCREMENT BY 1;';

        EXCEPTION;

        WHEN ANY DO
        BEGIN

        END
    end

  end

end
^

SET TERM ; ^




