Home > database >  A process of oracle, before to insert the data in a table to delete all the data in the table
A process of oracle, before to insert the data in a table to delete all the data in the table

Time:10-03

A process of oracle, before to insert the data in a table to delete all the data in the table, what is the role,

CodePudding user response:

This table, it is temporarily store data commonly used, delete before writing, in order to prevent data repeat,

CodePudding user response:

I prefer to drop table again create

CodePudding user response:

refer to the second floor and foliage quiet reply:
I prefer the first drop table again create

Dynamic use ctas also many,

CodePudding user response:

refer to the second floor u012557814 response:
I prefer the first drop table again create


If the above many associations, truncate

CodePudding user response:

If it is a temporary table temporary use, can choose the transaction level or session level special temporary table,

CodePudding user response:

In order to prevent data repeated injection, so using the delete or truncate;
Really want to delete or truncate, according to your insert... The from... The where... , from the back of the data situation,
Specific as follows, you from the table in addition to increased in accordance with the the where condition, data does not change other, use the delete, chances are you from the data is very large data, this time
Truncate insert after the time is too long; You change constantly, the from of table data to be deleted, the increase for the sake of consistency, in order to use truncate,
For example:
Insert into a from selet * from b where biggest reate_date='20170105';
A modified often watch is b, then you need to truncate, then insert into the from a selet * from b where biggest reate_date='20170105';
B table in addition to increase the data every day do not do other changes, then you can delete from a where clause a.c reate_date='20170105'; Then insert into the from a selet * from b where biggest reate_date='20170105';

The above reply is too hasty, I hope you can understand!

CodePudding user response:

refer to 6th floor POM_24 response:
in order to prevent repeated injection data, so using the delete or truncate.
Really want to delete or truncate, according to your insert... The from... The where... , from the back of the data situation,
Specific as follows, you from the table in addition to increased in accordance with the the where condition, data does not change other, use the delete, chances are you from the data is very large data, this time
Truncate insert after the time is too long; You change constantly, the from of table data to be deleted, the increase for the sake of consistency, in order to use truncate,
For example:
Insert into a from selet * from b where biggest reate_date='20170105';
A modified often watch is b, then you need to truncate, then insert into the from a selet * from b where biggest reate_date='20170105';
B table in addition to increase the data every day do not do other changes, then you can delete from a where clause a.c reate_date='20170105'; Then insert into the from a selet * from b where biggest reate_date='20170105';

The above reply is too hasty, I hope you can understand!
that last for more than half sentence, examples from b to insert data into a target table a, insert into the from a selet * from b,
  • Related