Skip site navigation (1) Skip section navigation (2)

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: (view raw, whole thread or download thread mbox)
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!


pgsql-general by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2018 The PostgreSQL Global Development Group