X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 46326D1BC4D for ; Thu, 4 Mar 2004 06:29:31 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 42733-02 for ; Thu, 4 Mar 2004 02:29:13 -0400 (AST) Received: from whowhere.com (in02-fes1.whowhere.com [209.202.220.218]) by svr1.postgresql.org (Postfix) with SMTP id 84B15D1B4B8 for ; Thu, 4 Mar 2004 02:29:13 -0400 (AST) Received: from Unknown/Local ([?.?.?.?]) by whowhere.com; Thu, 04 Mar 2004 06:29:07 -0000 To: pgsql-sql@postgresql.org Date: Wed, 03 Mar 2004 22:29:07 -0800 From: "William Anthony Lim" Message-ID: Mime-Version: 1.0 X-Sent-Mail: off Reply-To: wei.liang@eudoramail.com X-Mailer: MailCity Service X-Priority: 3 Subject: calling function X-Sender-Ip: 202.155.2.18 Organization: Lycos Mail (http://www.mail.eudoramail.com) Content-Type: text/plain; charset=us-ascii Content-Language: en Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200403/30 X-Sequence-Number: 17129 Hi, I have a little trouble. I'm newbie in postgresql. Consider this function example: create or replace function testcall(int4,varchar,bool,int2) return setof record as ' declare r record; a int4; b varchar; c bool; d int2; begin a=$1; b=$2; c=$3; d=$4; for r in select * from "T_Customer" loop return next r; end loop; return r; end;' language 'plpgsql' when i tried to call it using: select * from testcall(12,'ABCD',true,20000); it says: ERROR: function testcall(integer, "unknown", boolean, integer) does not exist then I tried to change to: select * from testcall(12,varchar'ABCD',true,20000); it says: ERROR: function testcall(integer, character varying, boolean, integer) does not exist I've tried them using jdbc prepared statement and callable statement (both with/without parameters), but the result is the same. what should i do? Thanks William Need a new email address that people can remember Check out the new EudoraMail at http://www.eudoramail.com