X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 9379553904 for ; Mon, 28 Mar 2005 10:20:41 +0100 (BST) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 86670-04 for ; Mon, 28 Mar 2005 09:20:37 +0000 (GMT) Received: from posta.erciyes.edu.tr (posta.erciyes.edu.tr [193.255.88.2]) by svr1.postgresql.org (Postfix) with ESMTP id B8BCA52AA8 for ; Mon, 28 Mar 2005 10:20:35 +0100 (BST) Received: from localhost (localhost [127.0.0.1]) by posta.erciyes.edu.tr (Postfix) with ESMTP id 0B8CFEF29 for ; Mon, 28 Mar 2005 11:16:14 +0200 (EET) Received: from [10.70.8.192] (unknown [193.255.88.12]) by posta.erciyes.edu.tr (Postfix) with ESMTP id 73E71EF22 for ; Mon, 28 Mar 2005 11:15:58 +0200 (EET) Message-ID: <4247CD11.4060303@erciyes.edu.tr> Date: Mon, 28 Mar 2005 12:23:29 +0300 From: =?ISO-8859-9?Q?Ejder_DA=DEKIN?= <1030515082@erciyes.edu.tr> User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206) X-Accept-Language: tr-TR, tr, en-US, en MIME-Version: 1.0 To: pgsql-jdbc@postgresql.org Subject: problem with returning a table Content-Type: text/plain; charset=ISO-8859-9; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by Erciyes University Antivirus System X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.723 tagged_above=0 required=5 tests=FROM_ENDS_IN_NUMS, UPPERCASE_25_50 X-Spam-Level: X-Archive-Number: 200503/204 X-Sequence-Number: 12596 Hi everybody, There is a function that returns a table. I set out parameter's type to Types.OTHER but When I call the function in java, returning type is returned as INTEGER . Here is the function: CREATE OR REPLACE FUNCTION sube_getir(int4, "varchar") RETURNS SETOF subeler AS $BODY$ DECLARE id ALIAS FOR $1; ad ALIAS FOR $2; ref record; BEGIN IF (id=0)AND(ad='') THEN for ref in SELECT * FROM subeler loop RETURN NEXT ref; end loop; return; ELSEIF (ad='') THEN for ref in SELECT * FROM subeler WHERE "HESAP_SUBE_ID"=id loop return next ref; end loop; return; ELSE for ref in SELECT * FROM subeler WHERE "HESAP_SUBE_ADI"=ad loop return next ref; end loop; return; END IF; END; $BODY$ LANGUAGE 'plpgsql' VOLATILE; ALTER FUNCTION sube_getir(int4, "varchar") OWNER TO postgres; --------calling function in java: sc = conn.prepareCall("{ ? = call sube_getir( ? , ? ) }"); sc.registerOutParameter(1,Types.OTHER); sc.setInt(2,4); sc.setString(3,""); sc.execute(); rs = (ResultSet)sc.getObject(1);