Hi,

i want to emulate the 'connect by' statement from Oracle.

my statement looks like this:

------------------------------------------------------
declare cursortest cursor for
with recursive PX (IDCOL,REFCOL,LVL) as
(
         select
                 ID, REFERENCE, 1
         from
                 TableA
         where
                 REFERENCE=0
         union all
         select
                 ID, REFERENCE, LVL+1
         from
                 TableA, PX
         where
                 REFERENCE=IDCOL
)
select
         LPAD(C.TRANSLATE_TEXT,4*(A.LVL-1)+1,'.',40),
         A.IDCOL,A.REFCOL,A.LVL
from
         PX A,
         TableA B,
         LanguageTable C
where
         A.IDCOL=B.ID AND
         B.TEXT_ID=C.TEXT_ID AND
         C.LNG_ID=1
------------------------------------------------------

this should show a tree-structure with language dependend strings.

Text1
....Text11
....Text12
........Text121
Text2
....Text21

.
.
.

How can I order the rows correct?

thanks

-- 
Thomas Markus
Tel: 030 29 36 399 - 18
mailto:[EMAIL PROTECTED]
Proventis GmbH
Torellstr. 1
10243 Berlin


_______________________________________________
sapdb.general mailing list
[EMAIL PROTECTED]
http://listserv.sap.com/mailman/listinfo/sapdb.general

Reply via email to