Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: archiving records
On 27 Aug 2006 21:58:05 -0700, "Daud" <daud11_at_hotmail.com> wrote:
> INSERT INTO MYTAB_ARC
> SELECT * FROM MYTAB WHERE ROWNUM < 100001';
>
> DELETE FROM MYTAB WHERE ROWNUM < 100001;
> -- have i deleted the same 100K rows that just got inserted?
No, there's no guarantee at all here. It may perhaps appear to work, possibly, but it'll be more by coincidence than design. If you're sticking with this approach, you'd need to store the primary keys or rowids selected in the first statement in order to delete the right rows in the second statement.
-- Andy Hassall :: andy@andyh.co.uk :: http://www.andyh.co.uk http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis toolReceived on Mon Aug 28 2006 - 07:54:12 CDT