Re: what does this do

From: John <johnf(at)jfcomputer(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: what does this do
Date: 2010-06-10 14:03:55
Message-ID: 201006100703.56312.johnf@jfcomputer.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

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(at)postgresql(dot)org
> [mailto:pgsql-sql-owner(at)postgresql(dot)org] On Behalf Of John Sent: Thursday,
> June 10, 2010 4:22 AM
> To: pgsql-sql(at)postgresql(dot)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

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Tim Landscheidt 2010-06-10 14:56:45 Re: what does this do
Previous Message Little, Douglas 2010-06-10 13:46:46 Re: what does this do