pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jean-Paul Argudo <jean-paul@argudo.org>
To: Scott Yohonn <syohonn@gmail.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: PL/PGSQL - How to pass in variables?
Date: Sun, 14 May 2006 20:50:21 +0200
Message-ID: <44677BED.7080803@argudo.org> (raw)
In-Reply-To: <ff1df1410605140917s465e7a89se96fd48130369b73@mail.gmail.com>
References: <ff1df1410605140828s2ac7c170j9d7c4e5b2b0a1f5c@mail.gmail.com>
	<44675072.8030104@argudo.org>
	<ff1df1410605140917s465e7a89se96fd48130369b73@mail.gmail.com>

Scott Yohonn wrote:
> Jean-Paul,
> 
> Thanks! This did work. The output put the name of the function
> (get_table_count) as the header. How would I display the name of the table
> that I am requesting the row count of?

The only way I know is to alias the output in the query calling the
function, so:


select get_table_count('bar') as bar;

 bar
-----
   3
(1 row)

I don't know any other way to do that...

Cheers,

-- 
Jean-Paul Argudo
www.PostgreSQLFr.org
www.dalibo.com



view thread (4+ messages)

Message-ID: <44677BED.7080803@argudo.org>
Permalink:  ../44677BED.7080803@argudo.org/
Also on:    postgresql.org/message-id/44677BED.7080803@argudo.org

 · 

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: jean-paul@argudo.org, syohonn@gmail.com
  Subject: Re: PL/PGSQL - How to pass in variables?
  In-Reply-To: <44677BED.7080803@argudo.org>

* 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