Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 803896321AC for ; Thu, 10 Jun 2010 11:04:08 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 07847-07 for ; Thu, 10 Jun 2010 14:03:59 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail.jfcomputer.com (unknown [76.14.161.106]) by mail.postgresql.org (Postfix) with ESMTP id 4841362D9D2 for ; Thu, 10 Jun 2010 11:04:01 -0300 (ADT) Received: from localhost (localhost [127.0.0.1]) by mail.jfcomputer.com (Postfix) with ESMTP id 276BC7DD58 for ; Thu, 10 Jun 2010 07:03:59 -0700 (PDT) X-Virus-Scanned: amavisd-new at jfcomputer.com Received: from mail.jfcomputer.com ([127.0.0.1]) by localhost (server1.jfcomputer.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 0vutn-7qWfJC for ; Thu, 10 Jun 2010 07:03:56 -0700 (PDT) Received: from [192.168.1.219] (unknown [192.168.1.219]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: johnf@mail.jfcomputer.com) by mail.jfcomputer.com (Postfix) with ESMTPSA id CDE4E7DD52 for ; Thu, 10 Jun 2010 07:03:56 -0700 (PDT) From: John To: pgsql-sql@postgresql.org Subject: Re: what does this do Date: Thu, 10 Jun 2010 07:03:55 -0700 User-Agent: KMail/1.9.9 References: <201006100222.03196.johnf@jfcomputer.com> <8585BA53443004458E0BAA6134C5A7FB06795979@EGEXCMB01.oww.root.lcl> In-Reply-To: <8585BA53443004458E0BAA6134C5A7FB06795979@EGEXCMB01.oww.root.lcl> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <201006100703.56312.johnf@jfcomputer.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=1.593 tagged_above=-5 required=5 tests=BAYES_50=0.8, RDNS_NONE=0.793 X-Spam-Level: * X-Archive-Number: 201006/41 X-Sequence-Number: 34232 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