CREATE OR REPLACE FUNCTION FIND_IN_SET (
piv_str1 VARCHAR2,
piv_str2 VARCHAR2,
p_sep VARCHAR2 := ','
) RETURNS INTEGER
AS
DECLARE
l_idx NUMBER := 0;
tmp text[];
BEGIN
SELECT regexp_split_to_array(piv_str2, p_sep) INTO tmp;
FOR i IN 0..array_length(tmp, 1) LOOP
IF piv_str1 = tmp[i] THEN
l_idx = i;
EXIT;
END IF;
END LOOP;
RETURN l_idx ;
END
人大金仓数据库开启 find_in_set函数
最新推荐文章于 2024-08-20 17:57:53 发布