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

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

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.