oracle 中的自定义函数迁移到mysql的问题
对于这块不是很了解oralce中额函数如下
CREATE OR REPLACE FUNCTION "GET_ROMA_NUM_PY"(p_Index NUMBER)
RETURN NUMBER IS
v_rom_num_list TROMA_NUM_LIST := TROMA_NUM_LIST(
'1','2','3','4','5','6','7','8','9','10','','','','','','',
'1','2','3','4','5','6','7','8','9','10','11','12','13','14','15','16','17','18','19','20',
'1','2','3','4','5','6','7','8','9','10','11','12','13','14','15','16','17','18','19','20',
'1','2','3','4','5','6','7','8','9','10','','',
'1','2','3','4','5','6','7','8','9','10','','',
'1','2','3','4','5','6','7','8','9','10','11','12','',''
);
BEGIN
IF (p_Index>0) AND (p_Index<95) THEN
RETURN v_rom_num_list(p_Index);
ELSE
RETURN '';
END IF;
end get_roma_num_py;
这个函数的意思是定义一个类似集合的东西,然胡根据传入的索引输出一个值,主要是
RETURN NUMBER IS
v_rom_num_list TROMA_NUM_LIST := TROMA_NUM_LIST(
'1','2','3','4','5','6','7','8','9','10','','','','','','',
'1','2','3','4','5','6','7','8','9','10','11','12','13','14','15','16','17','18','19','20',
'1','2','3','4','5','6','7','8','9','10','11','12','13','14','15','16','17','18','19','20',
'1','2','3','4','5','6','7','8','9','10','','',
'1','2','3','4','5','6','7','8','9','10','','',
'1','2','3','4','5','6','7','8','9','10','11','12','',''
);
如果改成mysql中的写法怎么写
发到oracle区没人理,还是到java块吧
感谢
更多 0
------解决方案--------------------貌似Mysql没有数组或集合的类型,只能用临时表来代替。