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

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

$
0
0

Hi Mani,

I suggest you test the script part by part and then go for the stored proc. See this example I create: I use trim and the result comes with a ddl which I can create back up. I am not aware of the reason you are using dbc.column. I feel your select distinct too you need to use trim.

 

select 'create table '||trim(databasename)||'.'||trim(tablename)||'_bkp as (sel * from '|| trim(databasename)||'.'||trim(tablename)||' ) with data' from dbc.tables 

 

where databasename='ABC' and tablename='def'.

 

 

 

Next you try for add partition. Hope you got this logic as a first step as i understand you want to take backup.Next you can substitute vTABLENAME

 

Are you being directed to use stored procedure only or you can use bteq etc too?

 

 

 

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>