17.05 - INSERT, DEFAULT Function, PERIOD Value Constructor, Scalar UDFs, UDTs, and Stored Procedures - Advanced SQL Engine - Teradata Database

Teradata Vantage™ - SQL Data Manipulation Language

Advanced SQL Engine
Teradata Database
Release Number
January 2021
English (United States)
Last Update

Using INSERT … SELECT With a DEFAULT Function

The following rules apply when using a DEFAULT function to load a table using an INSERT … SELECT operation:
  • All of the rules listed for DEFAULT Function in SELECT Statements also apply the SELECT subquery in an INSERT … SELECT request.
  • The DEFAULT function cannot be specified without a column name as its argument within the SELECT subquery of an INSERT … SELECT request.

For more information about the DEFAULT function, see Teradata Vantage™ - SQL Functions, Expressions, and Predicates, B035-1145.

Using a PERIOD Value Constructor With INSERT

For the rules on using PERIOD value constructors, see Teradata Vantage™ - SQL Date and Time Functions and Expressions, B035-1211. For examples of how to use PERIOD value constructors in INSERT requests, see Example: INSERT Using a PERIOD Value Constructor.

INSERT and Scalar UDFs

You can specify a scalar UDF as a column value in the VALUES clause of an INSERT request. The rules for the invocation of a scalar UDF in a VALUES clause are as follows.
  • A scalar UDF that passes a value in the VALUES list of an INSERT request must return a value expression.
  • The arguments passed to a scalar UDF must be constants, USING values, or parameters that resolve to a constant.

INSERT, UDTs, and Stored Procedures

The following rules apply to insert operations, UDTs, and stored procedures:
  • You can insert into a UDT local variable of a stored procedure.
  • You can insert a UDT local variable into a table.