I m not sure either what your after but if you want to basically pass into SQL an array of ints have you thought about passing in the string you have (which seems to be in Comma Seperated Values) and then splitting them into the values you need inside SQL. Then placing them in the desired table.
几天前,我不得不做一些类似的事情,但正是要建立一个Oracle数据库,而这个数据库并没有单独发挥作用。 该守则是简便的,你不应把它变成服务器。
CREATE OR REPLACE PACKAGE SPLIT_FNC IS
-- Create a Type to be used as a temp table
TYPE strArray IS TABLE OF VARCHAR2(30) INDEX BY BINARY_INTEGER;
FUNCTION SPLIT_STR(word IN VARCHAR2) RETURN strArray;
END;
CREATE OR REPLACE PACKAGE BODY SPLIT_FNC IS
FUNCTION SPLIT_STR(word IN VARCHAR2) RETURN strArray IS items strArray;
temp NUMBER;
delim CHAR := , ;
start_index NUMBER := 1;
end_index NUMBER := -1;
BEGIN
temp := 1;
-- If INSTR can not find a match it will return 0
WHILE end_index != 0 LOOP
-- Find location of next comma
end_index := INSTR(word, delim, start_index, 1);
CASE
WHEN
end_index = 0
THEN
-- Catch the last value
items(temp) := SUBSTR(word, start_index);
ELSE
-- Get substring of start to next comma
items(temp) := SUBSTR(word, start_index, end_index - start_index);
END CASE;
start_index := end_index + 1;
temp := temp + 1;
END LOOP;
RETURN items;
END SPLIT_STR;
END SPLIT_FNC;
Hopefully this is helpful - Ankou