All Forums Database
ChiaraReply 1 post Joined 06/16
27 Jun 2016
What is the equivalent of "CONNECT_BY_ISCYCLE" in Teradata

Hi 

 

I must make a porting of a query in Oracle that it  contains the CONNECT_BY.

 

 

I know that in Teradata it is replaced with the WITH RECOURSIVE, but there is also  the function  CONNECT_BY_ISCYCLE.

 

How can I replace it in TERADATA?

 

 

I report the query already migrated to Teradata, but which still contains CONNECT_BY_ISCYCLE function in the SELECT:

 

 WITH RECURSIVE temp as (

  SELECT 1 as level,CONNECT_BY_ISCYCLE ,PROVA_FICOMMO.*,
  PROVA_FICOMMO.FIIDNEW root_FIIDNEW,
  PROVA_FICOMMO.FI_DETAIL root_FI_DETAIL,
  PROVA_FICOMMO.MYFIID root_MYFIID 
  FROM BFD_SSL00_APPPRD.PROVA_FICOMMO  WHERE SSL_SNAPSHOT_DATE=20160503
  union all 
  select temp.LEVEL +1 ,CONNECT_BY_ISCYCLE ,PROVA_FICOMMO.*,
  temp.FIIDNEW root_FIIDNEW,
  temp.FI_DETAIL root_FI_DETAIL,
  temp.MYFIID root_MYFIID 
  from temp AS a, BFD_SSL00_APPPRD.PROVA_FICOMMO AS b
  where a.UNDERLYINGID = b.FIIDNEW

 )
 select * from temp;

 

Thanks in advance for the support.

You must sign in to leave a comment.