All Forums Database
emilahlstrom 11 posts Joined 11/13
10 Sep 2014
copying table from Prod to QA

Hi everyone,
I'm struggling with a problem where I'm suppose to copy the data from table Technical_year in prod environment to Technical_year in QA environment.
They are actually views and the definition looks today like:
For QA environment:
REPLACE VIEW DWQ_QFU.MAN_TECH_YEAR
AS
SELECT *
FROM
DWQ_QW.MAN_TECH_MODEL_YEAR;
 
For Prod environment:
REPLACE VIEW DWP_QFU.MAN_TECH_YEAR
AS
SELECT*
FROM
DWP_QW.MAN_TECH_MODEL_YEAR;
 
My job is to write a sql that copies that data from Prod to QA.
My question is, which is the most easiest and effeicient way to do this?
 
Best Regards
Emil
 
 
 
 
 

Raja_KT 1246 posts Joined 07/09
11 Sep 2014

Do you have tpt, or can you see tpt wizard?

Raja K Thaw
My wiki: http://en.wikipedia.org/wiki/User:Kt_raj1
Street Children suffer not by their fault. We can help them if we want.

emilahlstrom 11 posts Joined 11/13
11 Sep 2014

Actually I don't know what TPT or TPT Wizard is...
 
Mostly I just check my queries from BO Web Intelligence in Teradata and very seldom I do this kind of tasks.
I'm wondering if there is some general script for copying the data from one table into another.
 
Best regards
Emil

Raja_KT 1246 posts Joined 07/09
11 Sep 2014

I suggest you talk to the DBA --- if you can just do an insert ...select or how much data you want ...and when you can do .... not to disturb the production system.

Raja K Thaw
My wiki: http://en.wikipedia.org/wiki/User:Kt_raj1
Street Children suffer not by their fault. We can help them if we want.

emilahlstrom 11 posts Joined 11/13
11 Sep 2014

Ok, I see. Thank you for your help.
 
Let us think that I want to fill table A with data from table B. How should I then write the SQL?
 
Best Regards,
Emil

Raja_KT 1246 posts Joined 07/09
11 Sep 2014

You can use :
INSERT INTO your_databasename_QA.A SELECT * FROM your_databasename_PROD.B;
I give your_databasename_QA and  your_databasename_PROD as example only.
You can also think of using MERGE. But now you can use the above insert ...select

Raja K Thaw
My wiki: http://en.wikipedia.org/wiki/User:Kt_raj1
Street Children suffer not by their fault. We can help them if we want.

emilahlstrom 11 posts Joined 11/13
11 Sep 2014

Thank you very much Raja!

You must sign in to leave a comment.