Page 1 of 1

To clear a Teradata Table

Posted: Thu Jan 18, 2007 4:21 pm
by swades
Hi All,
I have a job Sequence , 3 job in batch mode, so i need to set up like that after finishing all my 3 job sucessfully i need to delete all data from one Teradata table.
so please tell me what stage should i use or what is possible way to do it?

Right now in my company they just made one table having same metadata defination but no data in it (Empty Table) and they load this empty table to main table at the end of job sequence(Clear the table, then insert rows)so the main table is going to empty.

but this kind of 10 jobs so i dont want create 10 empty table.

Reply me thanks.

Posted: Thu Jan 18, 2007 5:01 pm
by kumar_s
You can alternatively limit the row from the source of the exisining job design through a parameter.
If the source is from DB and if you have a Userdefined SQL, have a extra condition in WHERE class as 1=2 for no rows to extract and 1=1 for normal cases. Or if you have transformer, use @INROWNUM =0 for restricing the number of rows to flow.

Posted: Thu Jan 18, 2007 5:17 pm
by swades
kumar_s wrote:You can alternatively limit the row from the source of the exisining job design through a parameter.
If the source is from DB and if you have a Userdefined SQL, have a extra condition in WHERE class as 1=2 for no rows to extract and 1=1 for normal cases. Or if you have transformer, use @INROWNUM =0 for restricing the number of rows to flow.
No,I just want to clear one Teradata table after my 3 job sucessfully run.

Posted: Thu Jan 18, 2007 5:24 pm
by kumar_s
Yea, so you can call one of the three jobs which loads the table, again after the three jobs finished in Batch. Alternatively, you can use command line functions called in Routine or script.
Or use After SQL of the third job to Truncate the table.