oracle 11g PLS-00201问题
我用的是oracle 11.2.0.1
创建function语句:
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;/