Replace View - expected something between the word...

General

Replace View - expected something between the word...

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
SELECT ID_ATENCION,
CDG_OFICINA,
ID_SERVICIO_ATENCION,
ID_SERVICIO_ATENCION_EJEC,
NMR_ATENCION,
FCH_SOLATENCION,
HRA_SOLATENCION,
ID_RANGO_HORARIO_SOLIC,
cast(dayofweek(FCH_SOLATENCION) as INTEGER) as ID_DIA_SEMANA_SOL,
cast(dayofmonth(FCH_SOLATENCION) as INTEGER) as ID_MES_SOL,
FCH_ATENCION,
HRA_ATENCION,
ID_RANGO_HORARIO_ATEN,
ID_EST_ATENCION,
ID_MOT_FORZADO,
CDG_AUTOSERVICIO,
CDG_BP_PERSONAL,
CDG_BP_PERSONAL_REASIG,
NMR_COUNTER,
FLG_SS_PAX,
DNI_CLIENTE_NO_REG,
ID_CLIENTE,
NMB_CLIENTE,
APE_CLIENTE,
DSC_MAIL_CLIENTE,
ID_IDIOMA_CLIENTE,
VLR_TIEMPO_ESPERA,
VLR_TIEMPO_REASIGNACION,
VLR_TIEMPO_REINYECCION,
VLR_TIEMPO_ATENCION,
VLR_TIEMPO_FINALIZACION,
CNT_VENTAS,
CNT_SERVICIOS,
CNT_SUBMOTIVOS,
CNT_DET_SUBMOTIVO,
CNT_ACCIONES,
CNT_SUBTIPOS_ATENCION,
CNT_OPCIONES,
CNT_REGISTROS
FROM D_GSODA_ODS.ATENCION;
2 REPLIES
Senior Apprentice

Re: Replace View - expected something between the word...

You should add the actual error.

dayofweekdayofmonth 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? 


Re: Replace View - expected something between the word...

Dear, understood perfect! Thank you very much, you spent it !! It worked great! Very thankful.