Adding Multiple Columns with Default Value (Teradata)

Adding Multiple Columns with Default Value (Teradata)

I tried to search but I have not found anything. I am trying to add two columns to a table withe a default value (Teradata). I am trying with this statement

ALTER TABLE TEST 
add (DWH_Change_dt date  default CURRENT_DATE, dwh_create_dt date  default current_date);

This does not work with default clause. I get this error

Syntax error, expected something like a 'BETWEEN' keyword or an 'IN' keyword or a 'LIKE' keyword or a 'CONTAINS' keyword between the word 'DWH_Change_dt' and the 'date'

If I add one column at a time it works (without parenthesis). Anyone has any idea? What is wrong?

Thanks, Umberto

1 Answer

If you want to add multiple columns you need multiple ADDs:

ALTER TABLE TEST 
add DWH_Change_dt date  default CURRENT_DATE, 
add dwh_create_dt date  default current_date;
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Maya Lin-Takahashi
Author

Maya Lin-Takahashi

Maya is a hardware enthusiast who tests and reviews smart home devices, smartphones, wearables, and audio gear. She focuses on practical consumer value and build quality.