drop table if exists gapfl;
CREATE TABLE "gapfl" (
  "pgegapfl" varchar(150) COLLATE utf8_bin NOT NULL,
  "blkgapfl" varchar(30) COLLATE utf8_bin NOT NULL,
  "fldgapfl" varchar(30) COLLATE utf8_bin NOT NULL,
  "stlgapfl" varchar(30) COLLATE utf8_bin DEFAULT NULL,
  UNIQUE KEY "gapfl_fld" ("pgegapfl","blkgapfl","fldgapfl")
);

insert into gapfl values('QINFERENCEAIX71SRVDEVDVT116804','BXKCRG','EURO',NULL);

UPDATE gapfl
   SET stlgapfl = stlgapfl
 WHERE fldgapfl LIKE 'xxxxQS1NBE%'
   AND EXISTS (
         SELECT 1
           FROM gapfl x
          WHERE x.pgegapfl = gapfl.pgegapfl
            AND x.blkgapfl = gapfl.blkgapfl
            AND x.fldgapfl = gapfl.fldgapfl);
-- OK

analyze table gapfl persistent for all;

UPDATE gapfl
   SET stlgapfl = stlgapfl
 WHERE fldgapfl LIKE 'xxxxQS1NBE%'
   AND EXISTS (
         SELECT 1
           FROM gapfl x
          WHERE x.pgegapfl = gapfl.pgegapfl
            AND x.blkgapfl = gapfl.blkgapfl
            AND x.fldgapfl = gapfl.fldgapfl);

-- Error 1406
