Subject Re: [firebird-support] string difficulty
Author Virna Constantin
How can I get ABC*DEFG, leave the * between C*D, delete all * from right?



SET TERM ^ ;
CREATE PROCEDURE DEL_CHAR (
    M_SIR varchar(500),
    M_CHAR varchar(10) )
RETURNS (
    M_STR varchar(500) )
AS
    declare ii smallint; 
    declare iy smallint;
BEGIN
    m_str='';
    iy=char_length(m_sir);
    ii=1;
    while (ii<=iy) do
    begin
        if (position(substring(m_sir from ii for 1),m_char)=0) then
            m_str=m_str||substring(m_sir from ii for 1);
        ii=ii+1;
    end
END^
SET TERM ; ^

m_sir='ABC*DEFG'
m_char='*'