Re:

From: Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com>
To: Mario Alberto Soto Cordones <mario_soto(at)compuall(dot)cl>
Cc: <pgsql-sql(at)postgresql(dot)org>
Subject: Re:
Date: 2003-03-21 20:13:33
Message-ID: 20030321121210.V85996-100000@megazone23.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql


On Fri, 21 Mar 2003, Mario Alberto Soto Cordones wrote:

> 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&#7787;'t use select * becose the table its very long.

If you really want to return just three of the 49 columns, make a
composite type (see CREATE TYPE AS (...) ) and return a set of that type.

In response to

  • at 2003-03-21 18:50:23 from Mario Alberto Soto Cordones

Browse pgsql-sql by date

  From Date Subject
Next Message Ryan 2003-03-21 20:55:04 column label
Previous Message Josh Berkus 2003-03-21 19:45:58 Re: Diffcult query