From: Thomas Wegner <tomaten@t-online.de>
To: pgsql-sql@postgresql.org
Subject: Re: Oracle 'connect by prior' now eaiser in 7.3?
Date: Wed, 8 Oct 2003 21:38:00 +0200
Message-ID: <bm1p2g$98o$1@news.hub.org> (raw)
References: <B7AD8B4B4A337741B62E633B4827ADD90E2C08@svrexc02.aolau.ops.au.office.aol.com>
<3F6FC51F.6090105@joeconway.com>
Hello,
i have a table like this:
CREATE TABLE "public"."WINUSER" (
"ID_WINUSER" INTEGER NOT NULL,
"STATUS" INTEGER NOT NULL,
"CUSTOMERID" VARCHAR(8) NOT NULL,
"CUSTOMERPW" VARCHAR(100) NOT NULL,
"EMAIL" VARCHAR(100) NOT NULL,
"REF_ID_WINUSER" INTEGER,
PRIMARY KEY("ID_WINUSER"),
) WITH OIDS;
and will get the tree from this to fields:
"ID_WINUSER" INTEGER NOT NULL,
"REF_ID_WINUSER" INTEGER,
i write this sql:
SELECT "ID_WINUSER" FROM connectby('"WINUSER"', '"ID_WINUSER"',
'"REF_ID_WINUSER"', 4, 0, '~') AS t("ID_WINUSER" integer)
and get this error:
ERROR: Query-specified return tuple not valid for Connectby: wrong number
of columns
How is the correct use of connectby() for me?
------------------------------------------
Thomas Wegner
"Joe Conway" <mail@joeconway.com> schrieb im Newsbeitrag
news:3F6FC51F.6090105@joeconway.com...
> Merrall, Graeme wrote:
> > Am I right in thinking that recursive procedures and procs returning row
> > sets would allow us to better emulate this behaviour? As anyone looked
> > at it yet?
> >
>
> See connectby() in contrib/tablefunc. Someone was working on SQL99
> recursive queries but it didn't get done for 7.4 -- perhaps it will be
> in 7.5. In the meantime, connectby() is in 7.3 and might work for you.
>
> HTH,
>
> Joe
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 8: explain analyze is your friend
>
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: tomaten@t-online.de
Subject: Re: Oracle 'connect by prior' now eaiser in 7.3?
In-Reply-To: <bm1p2g$98o$1@news.hub.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox