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

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',8000006,
'Mall endast dokumentinnehåll',1,' ',
0,'230;230;230',0,' ',0,' ',1,' ',0,' ',
'180206','SCRIPT',
0,' ',0,' ',0,' ',1,' ',10,' ',0,
0,' ',0,' ',0,' ',7017,' ',0,' ',0,' ',0,' ',0,' ',0,'FC_EA_6_DokumentInnehall.sql',0,'09:39:44',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 = 8000006 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 = 8000006 and v04.dyndelsys = 2);


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


insert into ld0p0v04
(FORMNR, FORMNAME, PREFIX, ORIENTERING, OBJEKT, VISACOMBO, TYPDOK, DYNDELSYS, ANTALCOL, PARENT, NIVA, AVSNITT, FORMLOGO, VISAITRAD, SORTERING, AVSNITTSTYP, VERSION) values (
8000006,'Mall endast dokumentinnehåll',' ',1,7017,0,8000006,2,24,0,0,0,' ',0,0,0,0);

insert into ld0p0v05
(FORMNR, FRAGENR, SORTERING, VERSION, SIDNUMMER, DYNDELSYS, PAGEBREAK, ROWLOGIC) values (
8000006,101073627,1,0,0,2,0,'');
insert into ld0p0v05
(FORMNR, FRAGENR, SORTERING, VERSION, SIDNUMMER, DYNDELSYS, PAGEBREAK, ROWLOGIC) values (
8000006,101073628,2,0,0,2,0,'');
insert into ld0p0v05
(FORMNR, FRAGENR, SORTERING, VERSION, SIDNUMMER, DYNDELSYS, PAGEBREAK, ROWLOGIC) values (
8000006,101073629,3,0,0,2,0,'');
insert into ld0p0v05
(FORMNR, FRAGENR, SORTERING, VERSION, SIDNUMMER, DYNDELSYS, PAGEBREAK, ROWLOGIC) values (
8000006,101073630,4,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 (
101073627,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 (
101073627,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');



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

delete from LD0V0ParameterOption
where formnr = 8000006 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);

