pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: John <johnf@jfcomputer.com>
To: pgsql-sql@postgresql.org
Subject: Re: what does this do
Date: Thu, 10 Jun 2010 07:03:55 -0700
Message-ID: <201006100703.56312.johnf@jfcomputer.com> (raw)
In-Reply-To: <8585BA53443004458E0BAA6134C5A7FB06795979@EGEXCMB01.oww.root.lcl>
References: <201006100222.03196.johnf@jfcomputer.com>
	<8585BA53443004458E0BAA6134C5A7FB06795979@EGEXCMB01.oww.root.lcl>

On Thursday 10 June 2010 06:46:46 am Little, Douglas wrote:
> First remove the python
> select * from jfcs_balancedue(parameter) f(enrolleeid varchar,course_cost
> decimal, paid_amt decimal)
>
> the jfcs_balancedue is a table function,  f is the alias (with the column
> alias list/datatype of the columns returned by the function).
>
> Doug
>
>
> -----Original Message-----
> From: pgsql-sql-owner@postgresql.org
> [mailto:pgsql-sql-owner@postgresql.org] On Behalf Of John Sent: Thursday,
> June 10, 2010 4:22 AM
> To: pgsql-sql@postgresql.org
> Subject: [SQL] what does this do
>
> Hi,
> I have a piece of python code that excutes a SQL statement:
>
> apitempCur.execute("select * from jfcs_balancedue('%s') f(enrolleeid
> varchar, course_cost decimal, paid_amt decimal)" % (enrollIds,));
>
> The "enrollids" is a list of primary keys and the "jfcs_balancedue" is a
> user defined function.  What I don't understand is the "f(enrolleeid
> varchar, ...)"   I have no idea what it's for?  Would some kind soul
> educate me.
>
> Thanks in advance,
> Jhnf


Thanks folks the link you folks provided did the trick
 "If the function has been defined as returning the record data type, then an 
alias or the key word AS must be present, followed by a column"

I was not aware of the syntax required for returning the record data type.

Johnf




view thread (6+ messages)  latest in thread

Message-ID: <201006100703.56312.johnf@jfcomputer.com>
Permalink:  ../201006100703.56312.johnf@jfcomputer.com/
Also on:    postgresql.org/message-id/201006100703.56312.johnf@jfcomputer.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: johnf@jfcomputer.com
  Subject: Re: what does this do
  In-Reply-To: <201006100703.56312.johnf@jfcomputer.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