DECLARE c NUMBER; BEGIN LOOP c := 0; INSERT INTO controlsvia SELECT DISTINCT controls0.ATTR_0,controls0.ATTR_1, owns0.ATTR_1,owns0.ATTR_2 FROM controls controls0,owns owns0 WHERE controls0.ATTR_1=owns0.ATTR_0 AND (controls0.ATTR_0,controls0.ATTR_1,owns0.ATTR_1, owns0.ATTR_2) NOT IN (SELECT ATTR_0,ATTR_1,ATTR_2,ATTR_3 FROM controlsvia); c := c + SQL%ROWCOUNT; INSERT INTO controls SELECT DISTINCT controlsum0.ATTR_0,controlsum0.ATTR_1 FROM controlsum controlsum0 WHERE controlsum0.ATTR_2>0.5 AND (controlsum0.ATTR_0,controlsum0.ATTR_1) NOT IN (SELECT ATTR_0,ATTR_1 FROM controls); c := c + SQL%ROWCOUNT;
{}