

declare 
	y oidvector;
	i integer;
	str1 varchar = '';
	str2 varchar = '';
begin
	if x is not null then 
		i := 0;
		y := '';
	loop 
		if i <= length then 
			select case x[i] when 'i' then '1 ' 
					 when 'o' then '2 '  
					 when 'b' then '3 ' 
					 else '' 
				end
			into str2;
		
			str1 = str1 || str2;
			i := i + 1;
		else
			exit;
		end if;
	end loop;
end if;
	y := str1;
	return y;
end; 