DELETE FROM LD0P0Q01 WHERE KODTYP = 'TYPDOK' AND KOD = 8000017;

INSERT INTO LD0P0Q01
(KODTYP, KOD, KLARTEXT, AKTIV, EXTKOD, XNUM1, XTXT1, XNUM2, XTXT2, XNUM3, XTXT3, XNUM4, XTXT4, XNUM5, XTXT5, UPDDAT, UPDSIGN, XNUM6, XTXT6, XNUM7, XTXT7, XNUM8, XTXT8, XNUM9, XTXT9, XNUM10, XTXT10, SORTORDN, XNUM11, XTXT11, XNUM12, XTXT12, XNUM13, XTXT13, XNUM14, XTXT14, XNUM15, XTXT15, XNUM16, XTXT16, XNUM17, XTXT17, XNUM18, XTXT18, XNUM19, XTXT19, XNUM20, XTXT20, XNUM21, XTXT21, XNUM22, XTXT22, XNUM23, XTXT23, XNUM24, XTXT24, XNUM25, XTXT25, XNUM26, XTXT26, XNUM27, XTXT27, XNUM28, XTXT28, XNUM29, XTXT29, XNUM30, XTXT30, XNUM31, XNUM32, XNUM33, XNUM34, XNUM35, XNUM36, XNUM37, XNUM38, XNUM39, XNUM40, XNUM41, XNUM42, XNUM43, XNUM44, XNUM45, XNUM46, XNUM47, XNUM48, XNUM49, XNUM50) VALUES (
'TYPDOK',8000017,
'Mall Verkställighet endast dokumentation',1,' ',
0,'230;230;230',0,' ',0,' ',1,' ',0,' ',
'180206','SCRIPT',
0,' ',0,' ',0,' ',1,' ',10,' ',0,
0,' ',0,' ',0,' ',7025,' ',0,' ',0,' ',0,' ',0,' ',0,'FC_EA_17_VerkstallighetEndastDokumentation.sql',0,'14:09:52',0,' ',0,' ',0,' ',0,' ',0,' ',0,' ',0,' ',0,' ',0,' ',7,' ',0,0,0,0,0,2,0,0,1,0,0,0,0,0,0,0,0,0,0,0);

delete from ld0p0v02
where dyndelsys = 2 and exists (select 'x' from ld0p0v05 v05
              where v05.fragenr = ld0p0v02.fragenr
                and v05.formnr = 8000017 and v05.dyndelsys = 2);


delete from ld0p0v05
where dyndelsys = 2 and exists (select 'x' from ld0p0v04 v04
              where v04.formnr = ld0p0v05.formnr
                and v04.typdok = 8000017 and v04.dyndelsys = 2);


delete from ld0p0v04
where typdok = 8000017 and dyndelsys = 2;


insert into ld0p0v04
(FORMNR, FORMNAME, PREFIX, ORIENTERING, OBJEKT, VISACOMBO, TYPDOK, DYNDELSYS, ANTALCOL, PARENT, NIVA, AVSNITT, FORMLOGO, VISAITRAD, SORTERING, AVSNITTSTYP, VERSION) values (
8000017,'Mall Verkställighet endast dokumentation',' ',1,7025,0,8000017,2,24,0,0,0,' ',0,0,0,0);

insert into ld0p0v05
(FORMNR, FRAGENR, SORTERING, VERSION, SIDNUMMER, DYNDELSYS, PAGEBREAK, ROWLOGIC) values (
8000017,101074269,1,0,0,2,0,'');
insert into ld0p0v05
(FORMNR, FRAGENR, SORTERING, VERSION, SIDNUMMER, DYNDELSYS, PAGEBREAK, ROWLOGIC) values (
8000017,101093423,2,0,0,2,0,'');
insert into ld0p0v05
(FORMNR, FRAGENR, SORTERING, VERSION, SIDNUMMER, DYNDELSYS, PAGEBREAK, ROWLOGIC) values (
8000017,101074270,3,0,0,2,0,'');
insert into ld0p0v05
(FORMNR, FRAGENR, SORTERING, VERSION, SIDNUMMER, DYNDELSYS, PAGEBREAK, ROWLOGIC) values (
8000017,101074271,4,0,0,2,0,'');
insert into ld0p0v05
(FORMNR, FRAGENR, SORTERING, VERSION, SIDNUMMER, DYNDELSYS, PAGEBREAK, ROWLOGIC) values (
8000017,101074272,5,0,0,2,0,'');
insert into ld0p0v05
(FORMNR, FRAGENR, SORTERING, VERSION, SIDNUMMER, DYNDELSYS, PAGEBREAK, ROWLOGIC) values (
8000017,101074273,6,0,0,2,0,'');
insert into ld0p0v05
(FORMNR, FRAGENR, SORTERING, VERSION, SIDNUMMER, DYNDELSYS, PAGEBREAK, ROWLOGIC) values (
8000017,101074274,7,0,0,2,0,'');
insert into ld0p0v05
(FORMNR, FRAGENR, SORTERING, VERSION, SIDNUMMER, DYNDELSYS, PAGEBREAK, ROWLOGIC) values (
8000017,101074275,8,0,0,2,0,'');
insert into ld0p0v05
(FORMNR, FRAGENR, SORTERING, VERSION, SIDNUMMER, DYNDELSYS, PAGEBREAK, ROWLOGIC) values (
8000017,101074276,9,0,0,2,0,'');
insert into ld0p0v05
(FORMNR, FRAGENR, SORTERING, VERSION, SIDNUMMER, DYNDELSYS, PAGEBREAK, ROWLOGIC) values (
8000017,101074277,10,0,0,2,0,'');
insert into ld0p0v05
(FORMNR, FRAGENR, SORTERING, VERSION, SIDNUMMER, DYNDELSYS, PAGEBREAK, ROWLOGIC) values (
8000017,101074278,11,0,0,2,0,'');
insert into ld0p0v05
(FORMNR, FRAGENR, SORTERING, VERSION, SIDNUMMER, DYNDELSYS, PAGEBREAK, ROWLOGIC) values (
8000017,101074279,12,0,0,2,0,'');
insert into ld0p0v05
(FORMNR, FRAGENR, SORTERING, VERSION, SIDNUMMER, DYNDELSYS, PAGEBREAK, ROWLOGIC) values (
8000017,101074280,13,0,0,2,0,'');
insert into ld0p0v05
(FORMNR, FRAGENR, SORTERING, VERSION, SIDNUMMER, DYNDELSYS, PAGEBREAK, ROWLOGIC) values (
8000017,101074281,14,0,0,2,0,'');
insert into ld0p0v05
(FORMNR, FRAGENR, SORTERING, VERSION, SIDNUMMER, DYNDELSYS, PAGEBREAK, ROWLOGIC) values (
8000017,101074282,15,0,0,2,0,'');

insert into ld0p0v02
(FRAGENR, SVTYPLNR, SVTYP, SVKOMBOTYP, RADHOJD, KOLBREDD, TOMRAD, TOMKOL, RUBRIK, TYPSNITT, TEXTSTORLEK, VIKT,  KURSIV, UNDERSTRYK, OVERSTRYK, HORPOS, VERPOS, ORIENTERING, TACKCELLRAD, TACKCELLCOL, RAMSTIL, TOOLTIP, LONGTEXT, IDM_ID, IDME_ID, STATICDATA, TEXTLIMIT, VRAM, HRAM, TRAM, BRAM, ALLOWENTER, AUTOSIZE, DYNDELSYS, MAXRADER, STATM, OBLIG, KOPPL_FRAGENR, KOPPL_SVTYPLNR, CELLLOGIK, CELLID, HIDEPRINT, E_LETTER, RTFID, VERSION, SAMMANST_RUBRIK, SAMMANST_CELLID, EXTRATEXT, ALTDISPMODE) values (
101074269,1,0,0,15,55,0,0,' ','Arial',14,4,0,0,0,0,0,0,1,1,0,' ',0,0,0,0,0,0,0,0,0,0,0,2,0,' ',0,0,0,' ',' ',0,0,' ',0, ' ', ' ', ' ', '0');
insert into ld0p0v02
(FRAGENR, SVTYPLNR, SVTYP, SVKOMBOTYP, RADHOJD, KOLBREDD, TOMRAD, TOMKOL, RUBRIK, TYPSNITT, TEXTSTORLEK, VIKT,  KURSIV, UNDERSTRYK, OVERSTRYK, HORPOS, VERPOS, ORIENTERING, TACKCELLRAD, TACKCELLCOL, RAMSTIL, TOOLTIP, LONGTEXT, IDM_ID, IDME_ID, STATICDATA, TEXTLIMIT, VRAM, HRAM, TRAM, BRAM, ALLOWENTER, AUTOSIZE, DYNDELSYS, MAXRADER, STATM, OBLIG, KOPPL_FRAGENR, KOPPL_SVTYPLNR, CELLLOGIK, CELLID, HIDEPRINT, E_LETTER, RTFID, VERSION, SAMMANST_RUBRIK, SAMMANST_CELLID, EXTRATEXT, ALTDISPMODE) values (
101074270,2,3,0,30,30,0,0,'Ansökan','Arial',18,7,0,0,0,4,0,0,1,22,0,' ',0,7025,77,0,0,0,0,0,0,0,0,2,0,' ',0,0,0,' ',' ',0,0,' ',0, ' ', ' ', ' ', '0');
insert into ld0p0v02
(FRAGENR, SVTYPLNR, SVTYP, SVKOMBOTYP, RADHOJD, KOLBREDD, TOMRAD, TOMKOL, RUBRIK, TYPSNITT, TEXTSTORLEK, VIKT,  KURSIV, UNDERSTRYK, OVERSTRYK, HORPOS, VERPOS, ORIENTERING, TACKCELLRAD, TACKCELLCOL, RAMSTIL, TOOLTIP, LONGTEXT, IDM_ID, IDME_ID, STATICDATA, TEXTLIMIT, VRAM, HRAM, TRAM, BRAM, ALLOWENTER, AUTOSIZE, DYNDELSYS, MAXRADER, STATM, OBLIG, KOPPL_FRAGENR, KOPPL_SVTYPLNR, CELLLOGIK, CELLID, HIDEPRINT, E_LETTER, RTFID, VERSION, SAMMANST_RUBRIK, SAMMANST_CELLID, EXTRATEXT, ALTDISPMODE) values (
101074272,2,5,0,30,30,0,0,'AVSER','Arial',11,7,0,0,0,0,8,0,1,6,0,' ',0,0,0,0,0,0,0,0,0,0,0,2,0,' ',0,0,0,' ',' ',0,0,' ',0, ' ', ' ', ' ', '0');
insert into ld0p0v02
(FRAGENR, SVTYPLNR, SVTYP, SVKOMBOTYP, RADHOJD, KOLBREDD, TOMRAD, TOMKOL, RUBRIK, TYPSNITT, TEXTSTORLEK, VIKT,  KURSIV, UNDERSTRYK, OVERSTRYK, HORPOS, VERPOS, ORIENTERING, TACKCELLRAD, TACKCELLCOL, RAMSTIL, TOOLTIP, LONGTEXT, IDM_ID, IDME_ID, STATICDATA, TEXTLIMIT, VRAM, HRAM, TRAM, BRAM, ALLOWENTER, AUTOSIZE, DYNDELSYS, MAXRADER, STATM, OBLIG, KOPPL_FRAGENR, KOPPL_SVTYPLNR, CELLLOGIK, CELLID, HIDEPRINT, E_LETTER, RTFID, VERSION, SAMMANST_RUBRIK, SAMMANST_CELLID, EXTRATEXT, ALTDISPMODE) values (
101074272,14,5,0,30,30,0,0,'UTSKRIFTSDATUM','Arial',11,7,0,0,0,0,8,0,1,6,0,' ',0,0,41,0,0,0,0,0,0,0,0,2,0,' ',0,0,0,' ',' ',0,0,' ',0, ' ', ' ', ' ', '0');
insert into ld0p0v02
(FRAGENR, SVTYPLNR, SVTYP, SVKOMBOTYP, RADHOJD, KOLBREDD, TOMRAD, TOMKOL, RUBRIK, TYPSNITT, TEXTSTORLEK, VIKT,  KURSIV, UNDERSTRYK, OVERSTRYK, HORPOS, VERPOS, ORIENTERING, TACKCELLRAD, TACKCELLCOL, RAMSTIL, TOOLTIP, LONGTEXT, IDM_ID, IDME_ID, STATICDATA, TEXTLIMIT, VRAM, HRAM, TRAM, BRAM, ALLOWENTER, AUTOSIZE, DYNDELSYS, MAXRADER, STATM, OBLIG, KOPPL_FRAGENR, KOPPL_SVTYPLNR, CELLLOGIK, CELLID, HIDEPRINT, E_LETTER, RTFID, VERSION, SAMMANST_RUBRIK, SAMMANST_CELLID, EXTRATEXT, ALTDISPMODE) values (
101074273,2,3,0,20,30,0,0,' ','Times New Roman',14,4,0,0,0,0,0,0,1,10,0,' ',0,7000,106,0,0,0,0,0,0,0,0,2,0,' ',0,0,0,' ',' ',0,0,' ',0, ' ', ' ', ' ', '0');
insert into ld0p0v02
(FRAGENR, SVTYPLNR, SVTYP, SVKOMBOTYP, RADHOJD, KOLBREDD, TOMRAD, TOMKOL, RUBRIK, TYPSNITT, TEXTSTORLEK, VIKT,  KURSIV, UNDERSTRYK, OVERSTRYK, HORPOS, VERPOS, ORIENTERING, TACKCELLRAD, TACKCELLCOL, RAMSTIL, TOOLTIP, LONGTEXT, IDM_ID, IDME_ID, STATICDATA, TEXTLIMIT, VRAM, HRAM, TRAM, BRAM, ALLOWENTER, AUTOSIZE, DYNDELSYS, MAXRADER, STATM, OBLIG, KOPPL_FRAGENR, KOPPL_SVTYPLNR, CELLLOGIK, CELLID, HIDEPRINT, E_LETTER, RTFID, VERSION, SAMMANST_RUBRIK, SAMMANST_CELLID, EXTRATEXT, ALTDISPMODE) values (
101074273,14,3,0,20,30,0,0,' ','Times New Roman',14,4,0,0,0,0,0,0,1,10,0,' ',0,7255,41,0,0,0,0,0,0,0,0,2,0,' ',0,0,0,' ',' ',0,0,' ',0, ' ', ' ', ' ', '0');
insert into ld0p0v02
(FRAGENR, SVTYPLNR, SVTYP, SVKOMBOTYP, RADHOJD, KOLBREDD, TOMRAD, TOMKOL, RUBRIK, TYPSNITT, TEXTSTORLEK, VIKT,  KURSIV, UNDERSTRYK, OVERSTRYK, HORPOS, VERPOS, ORIENTERING, TACKCELLRAD, TACKCELLCOL, RAMSTIL, TOOLTIP, LONGTEXT, IDM_ID, IDME_ID, STATICDATA, TEXTLIMIT, VRAM, HRAM, TRAM, BRAM, ALLOWENTER, AUTOSIZE, DYNDELSYS, MAXRADER, STATM, OBLIG, KOPPL_FRAGENR, KOPPL_SVTYPLNR, CELLLOGIK, CELLID, HIDEPRINT, E_LETTER, RTFID, VERSION, SAMMANST_RUBRIK, SAMMANST_CELLID, EXTRATEXT, ALTDISPMODE) values (
101074274,2,3,0,30,30,0,0,' ','Times New Roman',14,4,0,0,0,0,1,0,1,10,0,' ',0,7000,1,0,0,0,0,0,0,0,0,2,0,' ',0,0,0,' ',' ',0,0,' ',0, ' ', ' ', ' ', '0');
insert into ld0p0v02
(FRAGENR, SVTYPLNR, SVTYP, SVKOMBOTYP, RADHOJD, KOLBREDD, TOMRAD, TOMKOL, RUBRIK, TYPSNITT, TEXTSTORLEK, VIKT,  KURSIV, UNDERSTRYK, OVERSTRYK, HORPOS, VERPOS, ORIENTERING, TACKCELLRAD, TACKCELLCOL, RAMSTIL, TOOLTIP, LONGTEXT, IDM_ID, IDME_ID, STATICDATA, TEXTLIMIT, VRAM, HRAM, TRAM, BRAM, ALLOWENTER, AUTOSIZE, DYNDELSYS, MAXRADER, STATM, OBLIG, KOPPL_FRAGENR, KOPPL_SVTYPLNR, CELLLOGIK, CELLID, HIDEPRINT, E_LETTER, RTFID, VERSION, SAMMANST_RUBRIK, SAMMANST_CELLID, EXTRATEXT, ALTDISPMODE) values (
101074275,2,5,0,30,30,0,0,'UPPRÄTTAD AV','Arial',11,7,0,0,0,0,8,0,1,3,0,' ',0,0,0,0,0,0,0,0,0,0,0,2,0,' ',0,0,0,' ',' ',0,0,' ',0, ' ', ' ', ' ', '0');
insert into ld0p0v02
(FRAGENR, SVTYPLNR, SVTYP, SVKOMBOTYP, RADHOJD, KOLBREDD, TOMRAD, TOMKOL, RUBRIK, TYPSNITT, TEXTSTORLEK, VIKT,  KURSIV, UNDERSTRYK, OVERSTRYK, HORPOS, VERPOS, ORIENTERING, TACKCELLRAD, TACKCELLCOL, RAMSTIL, TOOLTIP, LONGTEXT, IDM_ID, IDME_ID, STATICDATA, TEXTLIMIT, VRAM, HRAM, TRAM, BRAM, ALLOWENTER, AUTOSIZE, DYNDELSYS, MAXRADER, STATM, OBLIG, KOPPL_FRAGENR, KOPPL_SVTYPLNR, CELLLOGIK, CELLID, HIDEPRINT, E_LETTER, RTFID, VERSION, SAMMANST_RUBRIK, SAMMANST_CELLID, EXTRATEXT, ALTDISPMODE) values (
101074275,14,5,0,30,30,0,0,'TITEL','Arial',11,7,0,0,0,0,8,0,1,2,0,' ',0,0,0,0,0,0,0,0,0,0,0,2,0,' ',0,0,0,' ',' ',0,0,' ',0, ' ', ' ', ' ', '0');
insert into ld0p0v02
(FRAGENR, SVTYPLNR, SVTYP, SVKOMBOTYP, RADHOJD, KOLBREDD, TOMRAD, TOMKOL, RUBRIK, TYPSNITT, TEXTSTORLEK, VIKT,  KURSIV, UNDERSTRYK, OVERSTRYK, HORPOS, VERPOS, ORIENTERING, TACKCELLRAD, TACKCELLCOL, RAMSTIL, TOOLTIP, LONGTEXT, IDM_ID, IDME_ID, STATICDATA, TEXTLIMIT, VRAM, HRAM, TRAM, BRAM, ALLOWENTER, AUTOSIZE, DYNDELSYS, MAXRADER, STATM, OBLIG, KOPPL_FRAGENR, KOPPL_SVTYPLNR, CELLLOGIK, CELLID, HIDEPRINT, E_LETTER, RTFID, VERSION, SAMMANST_RUBRIK, SAMMANST_CELLID, EXTRATEXT, ALTDISPMODE) values (
101074276,2,3,0,22,30,0,0,' ','Times New Roman',14,4,0,0,0,0,2,0,1,10,0,' ',0,7255,15001,0,0,0,0,0,0,0,0,2,0,' ',0,0,0,' ',' ',0,0,' ',0, ' ', ' ', ' ', '0');
insert into ld0p0v02
(FRAGENR, SVTYPLNR, SVTYP, SVKOMBOTYP, RADHOJD, KOLBREDD, TOMRAD, TOMKOL, RUBRIK, TYPSNITT, TEXTSTORLEK, VIKT,  KURSIV, UNDERSTRYK, OVERSTRYK, HORPOS, VERPOS, ORIENTERING, TACKCELLRAD, TACKCELLCOL, RAMSTIL, TOOLTIP, LONGTEXT, IDM_ID, IDME_ID, STATICDATA, TEXTLIMIT, VRAM, HRAM, TRAM, BRAM, ALLOWENTER, AUTOSIZE, DYNDELSYS, MAXRADER, STATM, OBLIG, KOPPL_FRAGENR, KOPPL_SVTYPLNR, CELLLOGIK, CELLID, HIDEPRINT, E_LETTER, RTFID, VERSION, SAMMANST_RUBRIK, SAMMANST_CELLID, EXTRATEXT, ALTDISPMODE) values (
101074276,14,3,0,22,30,0,0,' ','Times New Roman',14,4,0,0,0,0,2,0,1,10,0,' ',0,7255,15000,0,0,0,0,0,0,0,0,2,0,' ',0,0,0,' ',' ',0,0,' ',0, ' ', ' ', ' ', '0');
insert into ld0p0v02
(FRAGENR, SVTYPLNR, SVTYP, SVKOMBOTYP, RADHOJD, KOLBREDD, TOMRAD, TOMKOL, RUBRIK, TYPSNITT, TEXTSTORLEK, VIKT,  KURSIV, UNDERSTRYK, OVERSTRYK, HORPOS, VERPOS, ORIENTERING, TACKCELLRAD, TACKCELLCOL, RAMSTIL, TOOLTIP, LONGTEXT, IDM_ID, IDME_ID, STATICDATA, TEXTLIMIT, VRAM, HRAM, TRAM, BRAM, ALLOWENTER, AUTOSIZE, DYNDELSYS, MAXRADER, STATM, OBLIG, KOPPL_FRAGENR, KOPPL_SVTYPLNR, CELLLOGIK, CELLID, HIDEPRINT, E_LETTER, RTFID, VERSION, SAMMANST_RUBRIK, SAMMANST_CELLID, EXTRATEXT, ALTDISPMODE) values (
101074277,2,0,0,15,30,0,0,' ','Arial',14,4,0,0,0,0,0,0,1,22,0,' ',0,0,0,0,0,0,0,1,0,0,0,2,0,' ',0,0,0,' ',' ',0,0,' ',0, ' ', ' ', ' ', '0');
insert into ld0p0v02
(FRAGENR, SVTYPLNR, SVTYP, SVKOMBOTYP, RADHOJD, KOLBREDD, TOMRAD, TOMKOL, RUBRIK, TYPSNITT, TEXTSTORLEK, VIKT,  KURSIV, UNDERSTRYK, OVERSTRYK, HORPOS, VERPOS, ORIENTERING, TACKCELLRAD, TACKCELLCOL, RAMSTIL, TOOLTIP, LONGTEXT, IDM_ID, IDME_ID, STATICDATA, TEXTLIMIT, VRAM, HRAM, TRAM, BRAM, ALLOWENTER, AUTOSIZE, DYNDELSYS, MAXRADER, STATM, OBLIG, KOPPL_FRAGENR, KOPPL_SVTYPLNR, CELLLOGIK, CELLID, HIDEPRINT, E_LETTER, RTFID, VERSION, SAMMANST_RUBRIK, SAMMANST_CELLID, EXTRATEXT, ALTDISPMODE) values (
101074278,2,14,0,15,30,0,0,' ','Times New Roman',14,4,0,0,0,0,0,0,4,22,0,' ',0,0,0,0,0,0,0,0,0,0,0,2,0,' ',0,0,0,' ',' ',0,0,' ',0, ' ', ' ', ' ', '0');
insert into ld0p0v02
(FRAGENR, SVTYPLNR, SVTYP, SVKOMBOTYP, RADHOJD, KOLBREDD, TOMRAD, TOMKOL, RUBRIK, TYPSNITT, TEXTSTORLEK, VIKT,  KURSIV, UNDERSTRYK, OVERSTRYK, HORPOS, VERPOS, ORIENTERING, TACKCELLRAD, TACKCELLCOL, RAMSTIL, TOOLTIP, LONGTEXT, IDM_ID, IDME_ID, STATICDATA, TEXTLIMIT, VRAM, HRAM, TRAM, BRAM, ALLOWENTER, AUTOSIZE, DYNDELSYS, MAXRADER, STATM, OBLIG, KOPPL_FRAGENR, KOPPL_SVTYPLNR, CELLLOGIK, CELLID, HIDEPRINT, E_LETTER, RTFID, VERSION, SAMMANST_RUBRIK, SAMMANST_CELLID, EXTRATEXT, ALTDISPMODE) values (
101093423,2,5,0,20,30,0,0,'VERKSTÄLLIGHET','Arial',11,7,0,0,0,4,0,0,1,22,0,' ',0,0,0,0,0,0,0,0,0,0,0,2,0,' ',0,0,0,' ',' ',0,0,' ',0, ' ', ' ', ' ', '0');



delete from LD0P0ParameterQuery
where formnr = 8000017 and dyndelsys = 2;

delete from LD0V0ParameterOption
where formnr = 8000017 and dyndelsys = 2;

update ld0p0lnr
set lnr = (select max(fragenr)+1 from ld0p0v05
          where dyndelsys = 2)
where lnrtyp = 66
 and lnr < (select max(fragenr)+1 from ld0p0v05
             where dyndelsys = 2);

update ld0p0lnr
set lnr = (select max(formnr)+1 from ld0p0v04
          where dyndelsys = 2)
where lnrtyp = 69
 and lnr < (select max(formnr)+1 from ld0p0v04
             where dyndelsys = 2);

