X-Original-To: pgsql-sql@postgresql.org Received: from localhost.localdomain (50-126-125.leased.cust.tie.cl [200.50.126.125]) by postgresql.org (Postfix) with ESMTP id 7D253475E91 for ; Fri, 21 Mar 2003 13:46:30 -0500 (EST) Received: from localhost.localdomain (lautaro [127.0.0.1]) by localhost.localdomain (8.12.8/8.12.5) with ESMTP id h2LIoOh6003387 for ; Fri, 21 Mar 2003 14:50:24 -0400 Received: (from apache@localhost) by localhost.localdomain (8.12.8/8.12.5/Submit) id h2LIoNe6003385; Fri, 21 Mar 2003 14:50:23 -0400 X-Authentication-Warning: localhost.localdomain: apache set sender to mario_soto@compuall.cl using -f Received: from 192.168.1.100 (SquirrelMail authenticated user mario_soto) by mail.compuall.cl with HTTP; Fri, 21 Mar 2003 14:50:23 -0400 (CLT) Message-ID: <33010.192.168.1.100.1048272623.squirrel@mail.compuall.cl> Date: Fri, 21 Mar 2003 14:50:23 -0400 (CLT) Subject: From: "Mario Alberto Soto Cordones" To: X-Priority: 1 Importance: High X-Mailer: SquirrelMail (version 1.2.10) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Archive-Number: 200303/506 X-Sequence-Number: 12545 HI, i have a following function., but not work. CREATE or replace FUNCTION get_nombre(numeric,numeric,text) RETURNS setof cumaalu AS ' SELECT cunomalu,cuappalu,cuapmalu FROM cumaalu WHERE siempalu = $1 and cusesalu = $2 and curutalu = $3; ' LANGUAGE SQL; the error say PostgreSQL ha dicho: ERROR: function declared to return cumaalu does not SELECT the right number of columns (49) Your query: CREATE FUNCTION get_nombre(numeric,numeric,text) RETURNS setof cumaalu AS ' SELECT cunomalu,cuappalu,cuapmalu FROM cumaalu WHERE siempalu = $1 and cusesalu = $2 and curutalu = $3; ' LANGUAGE SQL please any idea., i canṫ't use select * becose the table its very long. thank