Can anyone tell why I am getting no records returned for the following:

Given:

CREATE TABLE parentchild
(
 parent varchar(10),
 child  varchar(10)
)

With the following records:
           
PARENT CHILD           
Bart   Lisa        
Homer  Marge        
Marge  Bart        
Abe    Homer        
Ape    Abe

The folowing query returns no records:

DECLARE C CURSOR FOR
WITH RECURSIVE family(p,c) AS
  ( SELECT  parent, child 
    FROM    parentchild 
    WHERE   parent = 'Ape' 
  UNION ALL
    SELECT  parent, child 
    FROM    parentchild, family 
    WHERE   family.c = parentchild.parent 
  )
SELECT * FROM family

Statements successfully executed, no result !

Thanks,

Dan

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

Reply via email to