🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.interbase.sql
Article #11241

Tree Hierarchy

#11241
From: Marilia
Date: Thu, 28 Nov 2002 15:48
37 lines
1977 bytes
I have a table called Regions then I need to obtain then region and its
descendants ... my table has teh struct below :
CREATE TABLE regions(
       oid_region           NUMERIC(10) NOT NULL,
       oid_parent              NUMERIC(10),
       description            VARCHAR(50) NOT NULL,
       data_c               TIMESTAMP,
       data_u               TIMESTAMP,
       PRIMARY KEY (oid_region),
);

I need to know how to create a procedure that returns the values , for
example :

Table REGIONS

OID_REGION         OID_PARENT    DESCRIPTION

1                                0                            LATIN AMERICA
2                                1                            BRAZIL
3                                1                            BOLIVIA
4                                2                            SAO PAULO
5                                4                            BARUERI


I want the follow resut :

Brazil
Sao Paulo
Barueri


Could someone help me ?

Thanks so much ...

Marilia de Oliveira
Technical Details
Message-ID: <3de63b11$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-06!sn-xit-04!supernews.com!news.maxwell.syr.edu!eusc.inter.net!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 114a0e,df05a81330f93f25,start
X-Google-Attributes: gid114a0e,public
X-Google-ArrivalTime: 2002-11-28 08:09:03 PST
From: "Marilia" <moliveira@fpf.br>
Newsgroups: borland.public.interbase.sql
Followup-To: borland.public.interbase.general
Subject: Tree Hierarchy
Date: Thu, 28 Nov 2002 11:48:36 -0400
Lines: 39
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.00.2919.6700
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6700
NNTP-Posting-Host: 200.208.241.146
Message-ID: <3de63b11$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1038498577 200.208.241.146 (28 Nov 2002 07:49:37 -0800)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-06!sn-xit-04!supernews.com!news.maxwell.syr.edu!eusc.inter.net!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail