日期:2014-05-17 浏览次数:20891 次
CREATE OR REPLACE FUNCTION get_greece_alphabet_py(p_Index NUMBER) RETURN NUMBER IS v_greece_alphabet_list TGREECE_ALPHABET_LIST := TGREECE_ALPHABET_LIST( 'a','b','g','d','e','z','e','th','i','k','l','m','n','x','o','p','r', 's','t','u','ph','kh','ps','o' ); BEGIN IF (p_Index>0) AND (p_Index<95) THEN RETURN v_greece_alphabet_list(p_Index); ELSE RETURN ''; END IF; end get_greece_alphabet_py;
CREATE OR REPLACE FUNCTION get_greece_alphabet_py(p_Index NUMBER) RETURN NUMBER IS type TGREECE_ALPHABET_LIST is table of varchar2(10);--你使用了集合類型,但沒有定義,定義下就可以了 v_greece_alphabet_list TGREECE_ALPHABET_LIST := TGREECE_ALPHABET_LIST( 'a','b','g','d','e','z','e','th','i','k','l','m','n','x','o','p','r', 's','t','u','ph','kh','ps','o' ); BEGIN IF (p_Index>0) AND (p_Index<95) THEN RETURN v_greece_alphabet_list(p_Index); ELSE RETURN ''; END IF; end get_greece_alphabet_py; /
------解决方案--------------------
--可以 create or replace type TGREECE_ALPHABET_LIST is table of varchar2(10); / CREATE OR REPLACE FUNCTION get_greece_alphabet_py(p_Index NUMBER) RETURN NUMBER IS v_greece_alphabet_list TGREECE_ALPHABET_LIST := TGREECE_ALPHABET_LIST( 'a','b','g','d','e','z','e','th','i','k','l','m','n','x','o','p','r', 's','t','u','ph','kh','ps','o' ); BEGIN IF (p_Index>0) AND (p_Index<95) THEN RETURN v_greece_alphabet_list(p_Index); ELSE RETURN ''; END IF; end get_greece_alphabet_py; /