INSERT, DEFAULT Function, PERIOD Value Constructor, Scalar UDFs, UDTs, and Stored Procedures - Analytics Database - Teradata Vantage

SQL Data Manipulation Language

Deployment
VantageCloud
VantageCore
Edition
Enterprise
IntelliFlex
VMware
Product
Analytics Database
Teradata Vantage
Release Number
17.20
Published
June 2022
Language
English (United States)
Last Update
2024-12-13
dita:mapPath
pon1628111750298.ditamap
dita:ditavalPath
qkf1628213546010.ditaval
dita:id
esx1472246586715
lifecycle
latest
Product Category
Teradata Vantage™

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.