X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 887ADD1B537 for ; Fri, 10 Oct 2003 08:21:51 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 55132-09 for ; Fri, 10 Oct 2003 05:21:06 -0300 (ADT) Received: from news.hub.org (unknown [64.117.224.194]) by svr1.postgresql.org (Postfix) with ESMTP id 4D00BD1B506 for ; Fri, 10 Oct 2003 05:21:04 -0300 (ADT) Received: from news.hub.org (host-64-117-224-194.altec1.com [64.117.224.194] (may be forged)) by news.hub.org (8.12.9/8.12.9) with ESMTP id h9A8L3Qh042686 for ; Fri, 10 Oct 2003 08:21:03 GMT (envelope-from news@news.hub.org) Received: (from news@localhost) by news.hub.org (8.12.9/8.12.9/Submit) id h9A89brY041005 for pgsql-sql@postgresql.org; Fri, 10 Oct 2003 08:09:37 GMT From: "Thomas Wegner" X-Newsgroups: comp.databases.postgresql.sql Subject: Re: Oracle 'connect by prior' now eaiser in 7.3? Date: Fri, 10 Oct 2003 10:09:43 +0200 Organization: Hub.Org Networking Services Lines: 67 Message-ID: References: <3F6FC51F.6090105@joeconway.com> X-Complaints-To: usenet@news.hub.org X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 To: pgsql-sql@postgresql.org X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200310/147 X-Sequence-Number: 15547 Hello! Can anyone help me to use connectby() with my structure? I cannot change the name of tables. It is a import! ------------------------------------------ Thomas Wegner "Thomas Wegner" schrieb im Newsbeitrag news:bm1p2g$98o$1@news.hub.org... > 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" 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 > > > >