I'm trying to create a query in Teradata but it gives me REPLACE VIEW Failed. 3706: Syntax error: expected something between ')' and ','.
replace VIEW view as
x.BIRTHDATE as BIRTHDATE_DT,
case when (substring((x.cfisc_de), 12 , 5)=' ') then x.cfisc_de else null end as PIVA_CD,
case when (substring((x.cfisc_de), 12 , 5)<>' ') then x.cfisc_mask_de else null end as CFISC_CD,
FROM table1 a
INNER JOIN table2 x
Teradata supports two variations of substring:
SUBSTRING(col FROM n FOR m) SUBSTR(col, n , m)
You wrote a mixture of both. Depending on some ODBC settings this might work (it's automatically changed to valid SQL by the ODBC-driver, but only within a SELECT), but will fail in a CREATE or using .NET/JDBC/CLI.