Hi, I have very little time in Teradata and have found quite interesting. However I have a technical problem, I want to replace a view but gives me an error, however, the SELECT works perfectly. Please help. First of all, Thanks!!
REPLACE VIEW D_GSODA_VT.VT_ATENCION AS
LOCK D_GSODA_ODS.ATENCION FOR ACCESS MODE NOWAIT
cast(dayofweek(FCH_SOLATENCION) as INTEGER) as ID_DIA_SEMANA_SOL,
cast(dayofmonth(FCH_SOLATENCION) as INTEGER) as ID_MES_SOL,
You should add the actual error.
dayofweek & dayofmonth are no valid Teradata SQL functions, but ODBC syntax.
The ODBC driver replaces them (if "Disable Parsing" is switched off) with valid TD syntax only for SELECT-statements.
Use td_day_of_week & td_day_of_month instead.
Btw, in which part of the universe do weeks or years last 1,000,000,000 days?