X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 2CA33D1C9AB for ; Fri, 8 Aug 2003 14:42:37 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 36706-09 for ; Fri, 8 Aug 2003 11:41:14 -0300 (ADT) Received: from news.hub.org (news.hub.org [64.117.224.194]) by svr1.postgresql.org (Postfix) with ESMTP id 8547DD1C990 for ; Fri, 8 Aug 2003 11:42:26 -0300 (ADT) Received: from news.hub.org (news.hub.org [64.117.224.194]) by news.hub.org (8.12.9/8.12.9) with ESMTP id h78EgP1m012758 for ; Fri, 8 Aug 2003 14:42:25 GMT (envelope-from news@news.hub.org) Received: (from news@localhost) by news.hub.org (8.12.9/8.12.9/Submit) id h78EDtge004277 for pgsql-sql@postgresql.org; Fri, 8 Aug 2003 14:13:55 GMT From: proghome@silesky.com (krystoffff) X-Newsgroups: comp.databases.postgresql.sql Subject: Error message with a SQL function Date: 8 Aug 2003 07:13:28 -0700 Organization: http://groups.google.com/ Lines: 22 Message-ID: <85898f7e.0308080613.6cfb3e7c@posting.google.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Complaints-To: groups-abuse@google.com To: pgsql-sql@postgresql.org X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/82 X-Sequence-Number: 14698 Hi I try to create the following SQL function: CREATE FUNCTION update_affiliate(int,double precision,double precision) RETURNS void AS ' UPDATE affiliate SET balance=balance + $2, balance_in_points=balance_in_points + ( $2 / $3 ) WHERE id = $1; ' LANGUAGE 'sql'; but when I submit this query directly with PostgreSQL, I have the following error message: PostgreSQL said: ERROR: Unable to locate type oid 325664 in catalog I think the problem comes from the first parameter ($1) but I don't understand because affiliate.id is indeed the primary key of the table affiliate. Has anybody an idea ? Thanks Krystoffff