 UPDATE _import_optical_items 
  SET fajta2 = 
     (SELECT iog.kod 
        FROM _import_optical_groups iog
       WHERE iog.fajta_kod = 2 
         AND trim(iog.lang_0000040e) = trim(_import_optical_items.fajta2_nev))
  WHERE fajta2_nev <> '';

 UPDATE _import_optical_items 
  SET fajta3 = 
     (SELECT iog.kod 
        FROM _import_optical_groups iog
       WHERE iog.fajta_kod = 3 
         AND trim(iog.lang_0000040e||'×'||iog.nev_egyutt) = trim(_import_optical_items.fajta3_nev||'×'||_import_optical_items.fajta2_nev))
  WHERE fajta3_nev <> '';

 UPDATE _import_optical_items 
  SET fajta4 = 
     (SELECT iog.kod 
        FROM _import_optical_groups iog
       WHERE iog.fajta_kod = 4 
         AND trim(iog.lang_0000040e||'×'||iog.nev_egyutt) = trim(_import_optical_items.fajta4_nev||'×'||_import_optical_items.fajta3_nev||'×'||_import_optical_items.fajta2_nev))
  WHERE fajta4_nev <> '';

  UPDATE _import_optical_items 
  SET fajta5 = 
     (SELECT iog.kod 
        FROM _import_optical_groups iog
       WHERE iog.fajta_kod = 5 
         AND trim(iog.lang_0000040e||'×'||iog.nev_egyutt) = trim(_import_optical_items.fajta5_nev||'×'||_import_optical_items.fajta4_nev||'×'||_import_optical_items.fajta3_nev||'×'||_import_optical_items.fajta2_nev))
  WHERE fajta5_nev <> '';

 UPDATE _import_optical_items 
  SET fajta6 = 
     (SELECT iog.kod 
        FROM _import_optical_groups iog
       WHERE iog.fajta_kod = 6 
         AND trim(iog.lang_0000040e||'×'||iog.nev_egyutt) = trim(_import_optical_items.fajta6_nev||'×'||_import_optical_items.fajta5_nev||'×'||_import_optical_items.fajta4_nev||'×'||_import_optical_items.fajta3_nev||'×'||_import_optical_items.fajta2_nev))
  WHERE fajta6_nev <> '';