pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Fernando <fernando@icreativa.com.mx>
To: pgsql-sql@postgresql.org
Subject: SETOF
Date: Tue, 4 Mar 2003 11:44:44 -0600
Message-ID: <200303041144.44800.fernando@icreativa.com.mx> (raw)

Hi,
I am using Postgresql version 7.2.2 
I made a small function...

CREATE FUNCTION ejem1(varchar) RETURNS SETOF to varchar as' 
SELECT names from mi_tabla WHERE city = $1; ' 
language ' SQL '; 

  ejem1 
------------
  Sergio 
  Carlos 
  Fernando 

When wanting to obtain several columns I do this... 

CREATE FUNCTION ejem2(varchar) RETURNS SETOF mi_tabla as' 
SELECT * from mi_tabla WHERE city = $1;' 
language ' SQL '; 

  ejem2 
---------------
  137956448 
  137956448 
  137956448 

The number of registries that return is the correct, the question is, because 
it does not return the fields of the table, and that is what in its place 
this showing to me... 
Greetings and thank you very much!               



view thread (8+ messages)  latest in thread

Message-ID: <200303041144.44800.fernando@icreativa.com.mx>
Permalink:  ../200303041144.44800.fernando@icreativa.com.mx/
Also on:    postgresql.org/message-id/200303041144.44800.fernando@icreativa.com.mx

 · 

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: fernando@icreativa.com.mx
  Subject: Re: SETOF
  In-Reply-To: <200303041144.44800.fernando@icreativa.com.mx>

* 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