X-Original-To: pgsql-sql@postgresql.org Received: from spampd.localdomain (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id F00E7475A8D for ; Mon, 21 Apr 2003 17:33:09 -0400 (EDT) Received: from lautaro.compuall.cl (50-126-125.leased.cust.tie.cl [200.50.126.125]) by postgresql.org (Postfix) with ESMTP id AF594474E42 for ; Mon, 21 Apr 2003 17:33:08 -0400 (EDT) Received: from lautaro.compuall.cl (lautaro [127.0.0.1]) by lautaro.compuall.cl (8.12.8/8.12.5) with ESMTP id h3LLc6Pt012706 for ; Mon, 21 Apr 2003 17:38:06 -0400 Received: (from apache@localhost) by lautaro.compuall.cl (8.12.8/8.12.5/Submit) id h3LLc5Xh012704; Mon, 21 Apr 2003 17:38:05 -0400 X-Authentication-Warning: lautaro.compuall.cl: apache set sender to mario_soto@compuall.cl using -f Received: from 192.168.1.100 (SquirrelMail authenticated user mario_soto) by www.compuall.cl with HTTP; Mon, 21 Apr 2003 17:38:05 -0400 (CLT) Message-ID: <1848.192.168.1.100.1050961085.squirrel@www.compuall.cl> Date: Mon, 21 Apr 2003 17:38:05 -0400 (CLT) Subject: PROBLEM WITH FUNCTIONS 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: quoted-printable X-Spam-Status: No, hits=-5.4 required=5.0 tests=BAYES_01,SUBJ_ALL_CAPS,X_AUTH_WARNING,X_PRIORITY_HIGH version=2.50 X-Spam-Level: X-Spam-Checker-Version: SpamAssassin 2.50 (1.173-2003-02-20-exp) X-Archive-Number: 200304/309 X-Sequence-Number: 13010 Hi. i have a problem with a function. i create a type unidades CREATE TYPE unidades AS (codigo numeric(3,0), descripcion text); and i create a function get_unidades CREATE FUNCTION get_unidades(int4, int4, int4, int4) RETURNS typeof unidades AS ' SELECT cucoduni, cudesuni FROM cumauni WHERE cuempuni =3D $1 and cuseduni =3D $2 and cucaruni =3D $3 and cuasiuni=3D $4 ; ' LANGUAGE 'sql'; and at this moment=B4s it=B4s all ok BUT when execute this function select get_unidades(10,1,15,17) say "cannot display a value of type RECORD" any idea, PLEASE HELP MY saludos