pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Stephan Szabo <sszabo@megazone23.bigpanda.com>
To: Mario Alberto Soto Cordones <mario_soto@compuall.cl>
Cc: pgsql-sql@postgresql.org
Subject: Re:
Date: Fri, 21 Mar 2003 12:13:33 -0800 (PST)
Message-ID: <20030321121210.V85996-100000@megazone23.bigpanda.com> (raw)
In-Reply-To: <33010.192.168.1.100.1048272623.squirrel@mail.compuall.cl>


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.




view thread (2+ messages)

Message-ID: <20030321121210.V85996-100000@megazone23.bigpanda.com>
Permalink:  ../20030321121210.V85996-100000@megazone23.bigpanda.com/
Also on:    postgresql.org/message-id/20030321121210.V85996-100000@megazone23.bigpanda.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: sszabo@megazone23.bigpanda.com, mario_soto@compuall.cl
  Subject: Re:
  In-Reply-To: <20030321121210.V85996-100000@megazone23.bigpanda.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox