Re: UPDATE problem

From: Michael Bialik <bialik_at_isdn.net.il>
Date: 9 Nov 2001 05:22:43 -0800
Message-ID: <969f8022.0111090522.26e8ca34_at_posting.google.com>


Hi.

Try

 UPDATE /*+ USE_NL(a) INDEX(a) */ tab1 a  SET a.attrib_dest =

     (  SELECT b.attrib_source
         FROM  tab2 b
         WHERE a.key  = b.key
      )
 WHERE tab1.key IN
     ( SELECT d.key
        FROM  tab2 d
        WHERE d.attrib_source IS NOT NULL );

  1. You don't need to specify TAB1 in subselect of WHERE.
  2. There is a FULL TABLE SCAN on TAB2 ( IS NOT NULL can not use index ) so when dealing with 2 big table - it will take some time.

HTH. Michael. Received on Fri Nov 09 2001 - 14:22:43 CET

Original text of this message