Quantcast
Channel: Teradata Forums - Database
Viewing all articles
Browse latest Browse all 14773

Create back up tables using cursor - response (6) by Raja_KT

$
0
0

 

Hi Mani,

 

If you are not aware ,you can call a stored procedure from bteq.

 

I am under the impression that  you know how to create backup table and add partition. You have a look at the manual. It depends on how much the want automation and how much you can do.

 

You have already  enumerated the steps and you know them and that is good.I suggest you try step by step and see the result. So all it takes is just put the scripts.

 

say for example,PARTITION BY RANGE_N(date1 BETWEEN DATE '2013-03-01' AND DATE '2014-03-01' EACH INTERVAL '1' MONTH) . You can use alter table to add and drop partition

 

sample partition. you can customize as per your reqt.

ALTER TABLE abc

MODIFY

DROP RANGE BETWEEN DATE '2012-01-01'

AND DATE '2013-12-31'

EACH INTERVAL '1' MONTH

ADD RANGE BETWEEN DATE '2013-01-01'

AND DATE '2014-12-31'

EACH INTERVAL '1' MONTH

WITH DELETE;

 

 

You can call a stored proc from bteq:

.LOGON localtd/tduser, tdpass;

CALL SP('abc', 12345);

.LOGOFF

.EXIT

 

Cheers,

Raja


Viewing all articles
Browse latest Browse all 14773

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>