To clear a Teradata Table

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
swades
Premium Member
Premium Member
Posts: 323
Joined: Mon Dec 04, 2006 11:52 pm

To clear a Teradata Table

Post 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.
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post 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.
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
swades
Premium Member
Premium Member
Posts: 323
Joined: Mon Dec 04, 2006 11:52 pm

Post 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.
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post 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.
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
Post Reply