View Single Post

   
  #10 (permalink)  
Old 05-13-2008, 06:13 PM
JohnO
 
Posts: n/a
Default Re: Row and Statement based Trigger Question

On May 12, 9:20 pm, "walker.l2" <walker...@ukonline.co.uk> wrote:
> > Speed, mostly. This is a JDEdwards OneWorld site, so any batch work
> > will be written in the OneWorld toolset, and will likely end up bing
> > millions of individual inserts and deletes. The process would take
> > many days for some of the files.

>
> When all you have is a hammer, every problem lokos like a nail. :-)
>
> This is an ideal job for a couple of simple SQL statements (that can
> be run from a simple CL program if required).
> Something like:
> CREATE TABLE archive as SELECT * FROM mainfile WHERE date < sometime
> WITH DATA
> and
> DELETE FROM mainfile WHERE date < sometime
> should do the trick (N.B. I haven't checked the syntax of these, but
> you get the idea), with an index over the 'date' field for performance
> reasons.
> In future a simple CPYF *ADD command with a date selection could move
> records from mainfile to archive, and the SQL delete perform the tidy-
> up.


Interesting about the CPYF *ADD - will that perform faster than an
INSERT INTO ... SELECT ... FROM type SQL operation?
Reply With Quote