16.20 - Seed Statement Component of the View Definition - Teradata Database - Teradata Vantage NewSQL Engine

Teradata Vantage™ SQL Data Definition Language Detailed Topics

Product
Teradata Database
Teradata Vantage NewSQL Engine
Release Number
16.20
Release Date
March 2019
Content Type
Programming Reference
Publication ID
B035-1184-162K
Language
English (United States)

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.