Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.databases.postgresql > #587

Returning a table in SQL

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.fsmpi.rwth-aachen.de!goblin3!goblin.stu.neva.ru!news.netfront.net!not-for-mail
From "AP" <unixpro-nospam@verizon.spam.net>
Newsgroups comp.databases.postgresql
Subject Returning a table in SQL
Date Tue, 26 Aug 2014 13:39:05 -0400
Organization Netfront http://www.netfront.net/
Lines 27
Message-ID <ltignr$1hgl$1@adenine.netfront.net> (permalink)
NNTP-Posting-Host 108.21.243.187
Mime-Version 1.0
Content-Type text/plain; format=flowed; charset="iso-8859-1"; reply-type=original
Content-Transfer-Encoding 7bit
X-Trace adenine.netfront.net 1409074747 50709 108.21.243.187 (26 Aug 2014 17:39:07 GMT)
X-Complaints-To news@netfront.net
NNTP-Posting-Date Tue, 26 Aug 2014 17:39:07 +0000 (UTC)
X-Priority 3
X-MSMail-Priority Normal
Importance Normal
X-Newsreader Microsoft Windows Live Mail 15.4.3508.1109
X-MimeOLE Produced By Microsoft MimeOLE V15.4.3508.1109
X-Antivirus avast! (VPS 140816-1, 08/16/2014), Outbound message
X-Antivirus-Status Clean
Xref csiph.com comp.databases.postgresql:587

Show key headers only | View raw


Dear USENET,

If I have a function that returns a table , such as

create function some_report(in param1 text) returns table(rec1 integer, rec2 
text) as
$body$
    select blablabla from table1;
$body$ language 'sql'

with report as (select some_report('Customer','2014-08-01','2014-08-08') )
select * from report

still returns me a table with one column into which all record fields are 
packed.

How do I access rec1 and rec2 individually in such a case ?

Thank you all in advance ! 


---
This email is free from viruses and malware because avast! Antivirus protection is active.
http://www.avast.com


--- news://freenews.netfront.net/ - complaints: news@netfront.net ---

Back to comp.databases.postgresql | Previous | NextNext in thread | Find similar


Thread

Returning a table in SQL "AP" <unixpro-nospam@verizon.spam.net> - 2014-08-26 13:39 -0400
  Re: Returning a table in SQL Harry Tuttle <SOZRBLNTLEEE@spammotel.com> - 2014-08-26 21:10 +0200
    Re: Returning a table in SQL Robert Klemme <shortcutter@googlemail.com> - 2014-08-26 22:28 +0200
      Re: Returning a table in SQL Harry Tuttle <SOZRBLNTLEEE@spammotel.com> - 2014-08-26 23:34 +0200
        Re: Returning a table in SQL Robert Klemme <shortcutter@googlemail.com> - 2014-08-27 08:36 +0200
    Re: Returning a table in SQL "AP" <unixpronospam@verizon.net> - 2014-08-27 16:37 -0400
      Re: Returning a table in SQL Harry Tuttle <SOZRBLNTLEEE@spammotel.com> - 2014-08-28 17:51 +0200
        Re: Returning a table in SQL Robert Klemme <shortcutter@googlemail.com> - 2014-08-28 21:45 +0200
        Re: Returning a table in SQL Jasen Betts <jasen@xnet.co.nz> - 2014-08-30 05:45 +0000
        Re: Returning a table in SQL "AP" <unixpronospam@verizon.net> - 2014-09-01 03:02 -0400
          Re: Returning a table in SQL Jasen Betts <jasen@xnet.co.nz> - 2014-09-01 10:56 +0000
            Re: Returning a table in SQL "AP" <unixpronospam@verizon.net> - 2014-09-04 02:57 -0400
              Re: Returning a table in SQL Jasen Betts <jasen@xnet.co.nz> - 2014-09-04 11:21 +0000
  Re: Returning a table in SQL Lennart Jonsson <erik.lennart.jonsson@gmail.com> - 2014-08-27 19:33 +0200

csiph-web