-1

i have two data tables A and B in sql database .

i want to copy the content of table A to table B i am not able to copy the content of table A if it has dependencies (foreign key relationship)please help me with the control file code (which is present in SQL loader like sqldir) and my intention is to copy (export)the contents from one table in windows and copy (import) the contents into other table using script(.sh or .ctl file),i followed the below approach : sql loader using control file(.ctol file).Thanks..

Regards, Vamsi Alla

vamsi
  • 1

1 Answers1

0

While not a direct answer to your question, why go through the hassle when you can do it directly from SQL (your syntax may vary, but you get the idea)?

INSERT INTO table_b (column1, column2, ... )
  SELECT column1, column2, ... 
  FROM table_a
  [WHERE conditions];
Gary_W
  • 9,933
  • 1
  • 22
  • 40