CREATE OR ALTER FUNCTION F_REMOVE_SPECIALCHARS(
IN_STR VARCHAR(8000))
RETURNS VARCHAR(8000)
AS
declare variable IN_SIZE integer;
declare variable IDX integer;
declare variable OUT_STR varchar(8000);
begin
/* Function Text */
in_size = char_length(IN_STR);
idx = 1;
out_str = '';
while (idx < in_size+1) do
begin
if (lower(substring(in_str from idx for 1)) in
('a','b','c','d','e','f','g','h','i',
'l','m','n','o','p','q','r','s','t',
'u','v','x','y','k','j','@','-','_',
'1','2','3','4','5','6','7','8','9',
'0',' ')
) then
begin
out_str = out_str || substring(in_str from idx for 1);
end
idx = idx + 1;
end
return out_str;
end
1条答案
按热度按时间4xrmg8kj1#
你可以使用像”substring(src_str类似)这样的语法,如果你需要更简单的语法,你可以创建自己的函数,比如:
在这种情况下,您可以维护所需字符的选择