Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to insert values into a table after truncation ?

647530Jul 8 2008 — edited Jul 8 2008
Hi experts,

I have two tables suppose aa and bb in my local server .Now bb has the same structure as that of aa .Now i want to truncate the table aa and insert all the values of bb into aa.


I am not getting the correct way to proceed.In the following code i have tried to truncate the table aa but now how will i insert all the row entries into the table aa from the table bb.please help me in this regard.Can u give me any sql commands or stored procedure to acheive the same ..

Looking forward for ur response....

[\n]

SQL> create table aa(
2 sid varchar2(20),
3 name varchar2(20)
4 )
5 /

Table created.

SQL> insert into aa values('12','bb');

1 row created.

SQL> insert into aa values('13','cc');

1 row created.

SQL> TRUNCATE TABLE aa DROP STORAGE;

Table truncated.

SQL> select * from aa;

no rows selected


[n]
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 5 2008
Added on Jul 8 2008
8 comments
1,811 views