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

SQL Data Definition Language Detailed Topics

Product
Advanced SQL Engine
Teradata Database
Release Number
17.10
Published
July 2021
Language
English (United States)
Last Update
2021-07-27
dita:mapPath
imq1591724555718.ditamap
dita:ditavalPath
imq1591724555718.ditaval
dita:id
B035-1184
lifecycle
previous
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.