Equivalent to Oracle's inline CURSOR in a SELECT clause?

From: "Doug Bloebaum" <DBloebau(at)luxotticaRetail(dot)com>
To: <pgsql-general(at)postgresql(dot)org>
Cc: "Chris Barth" <CBarth(at)luxotticaRetail(dot)com>
Subject: Equivalent to Oracle's inline CURSOR in a SELECT clause?
Date: 2004-08-27 15:11:41
Message-ID: s12f170c.021@smtp.luxotticaretail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

In Oracle I can do this:

SELECT h.transaction_number
CURSOR(SELECT d.detail_number
FROM detail d
WHERE d.transaction_number=h.transaction_number)
FROM header h
WHERE h.transaction_date='25-aug-2004'

which comes in handy once in a while for nested parent/child
relationships, especially when using Oracle's XSQL servlet to produce
XML from queries.

Is there an equivalent syntax in PostgreSQL?

P.S. Half surprisingly, the Oracle XSQL servlet works just fine with
PostgreSQL as a backend!

Browse pgsql-general by date

  From Date Subject
Next Message Jeff Amiel 2004-08-27 16:21:11 upgrading minor versions
Previous Message Joseph Shraibman 2004-08-27 15:09:26 Re: performance of IN (subquery)