From: | Richard Broersma <richard(dot)broersma(at)gmail(dot)com> |
---|---|
To: | pgsql-sql(at)postgresql(dot)org |
Subject: | Re: what does this do |
Date: | 2010-06-10 13:42:27 |
Message-ID: | AANLkTim52D_0yvXC9Y9eAJjIGoBm1WaIopfFjobz55R2@mail.gmail.com |
Views: | Whole Thread | Raw Message | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-sql |
On Thu, Jun 10, 2010 at 3:57 AM, Tim Landscheidt <tim(at)tim-landscheidt(dot)de> wrote:
> John <johnf(at)jfcomputer(dot)com> wrote:
>
>> 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.
>
> You can omit the "AS" from "table_name AS alias
> (column_alias, ...)", but AFAIK PostgreSQL doesn't support
> specifying a data type for each column. Which DBMS is this
> code used for?
Well, it doesn't support data-types in the alias declaration for all
set returning relations with the exception of a set returning function
(i.e. store procedure). The from clause has a give-away that this is
a set returning function: "jfcs_balancedue('%s')" since it has a
parameter.
Notice the function name section taken from the from clause:
http://www.postgresql.org/docs/9.0/static/sql-select.html#SQL-FROM
--
Regards,
Richard Broersma Jr.
Visit the Los Angeles PostgreSQL Users Group (LAPUG)
http://pugs.postgresql.org/lapug
From | Date | Subject | |
---|---|---|---|
Next Message | Little, Douglas | 2010-06-10 13:46:46 | Re: what does this do |
Previous Message | Tim Landscheidt | 2010-06-10 10:57:07 | Re: what does this do |