Home » SQL & PL/SQL » SQL & PL/SQL » Procedure/script to move selected data into an archive table
Procedure/script to move selected data into an archive table [message #35727] Wed, 10 October 2001 11:57 Go to next message
Trevor Pearson
Messages: 5
Registered: October 2001
Junior Member
Does anybody have a procedure or script to move selected data from one table into an archive table of the same structure? For instance, all data inserted after a certain date?

----------------------------------------------------------------------
Re: Procedure/script to move selected data into an archive table [message #35729 is a reply to message #35727] Wed, 10 October 2001 12:21 Go to previous message
Todd Barry
Messages: 4819
Registered: August 2001
Senior Member
If the structures of the two tables are identical, then you can simply:

insert into archive_table
select * from source_table
where tran_date >= :somedate;

delete from source_table
where tran_date >= :somedate;

----------------------------------------------------------------------
Previous Topic: Re: ORA-00600: internal error code, arguments: [15267], [223], [], [], [], [], [], []
Next Topic: Printing variables in html forms
Goto Forum:
  


Current Time: Thu Mar 28 13:53:52 CDT 2024