2010-06-21 26 views
0

我正在嘗試一個存儲過程,如下所示。錯誤:運算符不存在:dom_id =在字符65處變化的字符在Postgres SQL

CREATE OR REPLACE FUNCTION "public"."get_fees" (VARCHAR(5000)) RETURNS text[] AS 
$body$ 
DECLARE 
student_ids ALIAS FOR $1; 
studetFee text[]; 
BEGIN 
FOR studetFee IN 
    SELECT * FROM Student_fee WHERE student_id IN (student_ids::VARCHAR(5000)) 
LOOP 
    **** some *** 
END LOOP; 
END; 
$body$ 

它顯示我以下錯誤,當我試圖此查詢

SELECT * FROM get_fees('1,2,3,4,5'::VARCHAR(5000)); 

ERROR: operator does not exist: dom_id = character varying at character 65 
HINT: No operator matches the given name and argument type(s). You might need to add explicit type casts. 

可能是什麼問題。

感謝 拉胡爾

回答

0

你不能這樣做「其中student_id數據中(VARCHAR)」你必須分析字符串到一個列表。

0

studetFee必須是一個記錄類型

相關問題