Components of the View Definition | CREATE RECURSIVE VIEW | Teradata Vantage - Seed Statement Component of the View Definition - Analytics Database - Teradata Vantage

SQL Data Definition Language Detailed Topics

Deployment
VantageCloud
VantageCore
Edition
Enterprise
IntelliFlex
VMware
Product
Analytics Database
Teradata Vantage
Release Number
17.20
Published
June 2022
ft:locale
en-US
ft:lastEdition
2024-12-13
dita:mapPath
vuk1628111288877.ditamap
dita:ditavalPath
qkf1628213546010.ditaval
dita:id
jbg1472252759029
lifecycle
latest
Product Category
Teradata Vantage™

A seed statement is the non-recursive statement portion of a recursive view definition. Its purpose is to provide the initial row set to be used to build a recursive relation later in the process. To produce the desired recursion, the seed statement must produce 1 or more rows; otherwise, running the recursive query produces an empty result set.

By definition, there are no references to recursive relations anywhere in the seed statement. Taking the example developed in The Concept of Recursion, the code highlighted in bold typeface is the seed statement for the definition.

CREATE RECURSIVE VIEW reachable_from (source,destination,depth) AS (
  SELECT root.source, root.destination, 0 AS depth 
  FROM flights AS root 
  WHERE root.source ='Paris'
UNION ALL
  SELECT in1.source, out1.destination, in1.depth + 1
  FROM reachable_from in1, flights AS out1
  WHERE in1.destination = out1.source
  AND   in1.depth <= 100);

As you can see, there are no references to recursive relations within the seed query.