Some parts in the output code are omitted for clarity reasons.
Description
Teradata's WITH DEFAULT clause sets a system-default value to columns that are inserted with no values. This value is typically the equivalent of zero or empty.
Syntax:
WITHDEFAULT
The following table shows Teradata's data types, their corresponding type in Snowflake, and the default value to be set if supported.
Teradata
Snowflake
Default Value
Sample Source Patterns
Teradata
IN -> Teradata_01.sql
CREATETABLESAMPLE_TABLE( ID INT,-- Numeric Types big_integer_col BIGINTWITHDEFAULT, byteint_col BYTEINT WITHDEFAULT, decimal_col DECIMAL(10,2) WITHDEFAULT, double_precision_col DOUBLE PRECISIONWITHDEFAULT, float_col FLOATWITHDEFAULT, integer_col INTEGERWITHDEFAULT, number_col NUMBERWITHDEFAULT, numeric_col NUMERIC(10,2) WITHDEFAULT, real_col REALWITHDEFAULT, smallint_col SMALLINTWITHDEFAULT,-- Character Types char_col CHAR(50) WITHDEFAULT, character_col CHARACTER(50) WITHDEFAULT,--clob_col CLOB, char_varying_col CHAR VARYING(100) WITHDEFAULT,--long_varchar_col LONG VARCHAR WITH DEFAULT,--long_varchar_graphic_col LONG VARCHAR CHARACTER SET GRAPHIC WITH DEFAULT, varchar_col VARCHAR(255) WITHDEFAULT,--varchar_graphic_col VARCHAR(255) CHARACTER SET GRAPHIC WITH DEFAULT,-- Date and Time Types date_col DATEWITHDEFAULT, time_col TIMEWITHDEFAULT, time_precision_col TIME(6) WITHDEFAULT, timestamp_col TIMESTAMPWITHDEFAULT, timestamp_precision_col TIMESTAMP(6) WITHDEFAULT, tz_timestamp_col TIMESTAMP WITH TIME ZONEWITHDEFAULT, tz_timestamp_precision_col TIMESTAMP(6) WITH TIME ZONEWITHDEFAULT, interval_col INTERVAL DAY(4) WITHDEFAULT, interval_day_to_hour_col INTERVAL DAY(4) TOHOURWITHDEFAULT, interval_hour_col INTERVAL HOUR(2) WITHDEFAULT, interval_minute_col INTERVAL MINUTE(2) WITHDEFAULT, interval_month_col INTERVAL MONTHWITHDEFAULT, interval_second_col INTERVAL SECOND(2) WITHDEFAULT, interval_year_col INTERVAL YEAR(4) WITHDEFAULT,-- Binary Types-- blob_col BLOB(1000), byte_col BYTE(1000) WITHDEFAULT, varbyte_col VARBYTE(1000) WITHDEFAULT);