ola só
nao tenho o substring, mas o substr, fiz assim:
set term ^;
create procedure teste (texto varchar(50), inicio numeric(3), tamanho
numeric(3))
as
declare local varchar(50);
BEGIN
select substr(:texto,:inicio, :tamanho) from rdb$database
into :local;
end;
^
set term ;^
funciona