There is not a unique answer for this, and it depends on various factors. It seems too much time, but may be more info can help to see this case, so please, answer this questions:
1) how many records have each of the involved tables? 2) what is the final UPDATE that worked for you? 3) what indexes have each table? El 30/07/2014 02:06, "Sytze de Boer" <[email protected]> escribió: > Everyone, thank you for your help. > My old routine took point 419 seconds, the new routine point 350 > > This leads to my next question > Which of the two methods is *better* (i.e. used by experts) > 1 Update, set etc > 2 Scan/endscan with replace > 3 set a relation and replace all > > By *better*, I'm referring to speed and record/file locking. > > > > > > > > On Wed, Jul 30, 2014 at 11:46 AM, Fernando D. Bozzo <[email protected]> > wrote: > > > If this doesn't work, you can add a condition for "AND NOT NULL qty" in > the > > Select-SQL > > > > > > > > > > 2014-07-30 1:45 GMT+02:00 Fernando D. Bozzo <[email protected]>: > > > > > In this case, something like this: > > > > > > UPDATE stocktable SET qty = ( select SUM( *NVL(qty,0)* ) as ttl FROM > > > invtable where invtable.stockcode=stocktable.code ) > > > > > > I'm not sure if I'm using NVL apropiately in this case (because of the > > SUM > > > function), but NVL() is the function to intercept NULLs and convert to > 0 > > or > > > any value you want. > > > > > > > > > > > > 2014-07-30 1:41 GMT+02:00 Sytze de Boer <[email protected]>: > > > > > > Fernando, this is really helpful, but I'm stuck on the .NULL. matter. > > >> i.e. I get the error message, field Qty does not accept null values > > >> > > >> > > >> > > > > > > > > > > > > --- StripMime Report -- processed MIME parts --- > > multipart/alternative > > text/plain (text body -- kept) > > text/html > > --- > > [excessive quoting removed by server] _______________________________________________ Post Messages to: [email protected] Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech Searchable Archive: http://leafe.com/archives/search/profox This message: http://leafe.com/archives/byMID/profox/CAGQ_JukZydhf8REyx94qXgWe2=8wwxzkzosukqvxxqeyn0k...@mail.gmail.com ** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.

