I am trying to convert SQL query to Teradata. The below if clause is giving me an error "Statement 1: IF Failed. [3706] Syntax error: expected something between the beginning of the request and the 'if' keyword."
if OBJECT_ID('temp db.#temp_tick') is not null
DROP TABLE #temp_tick
and In next part of the query, I am creating a table, insert into and then a select from. And ended up with an error "[Teradata Database] [3932] Only an ET or null statement is legal after a DDL Statement."
createvolatiletable #temp_tick
( BNK_NUM Varchar(2),
CUST_FAC Varchar(10),
FAC_NUM Varchar(10),
TICKind varchar(1));
insertinto #temp_tick
select cast(tick.BNK_NUM as Varchar(2)) AS BNK_NUM,
cast(tick.CUST_FAC as Varchar(10)) AS CUST_FAC,
cast(tick.FAC_NUM as Varchar(10)) AS FAC_NUM
from tablename
group by
tick.BNK_NUM,
tick.CUST_FAC,
tick.FAC_NUM
Any help is appreciated.
Thanks in advance!
neetu
Forums: