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

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',8000026,
'Journalanteckningslista sidhuvud',1,' ',
0,' ',0,' ',0,' ',1,' ',0,' ',
'160425','SCRIPT',
0,' ',0,' ',0,' ',0,' ',0,' ',0,
0,' ',0,' ',0,' ',7027,' ',0,' ',0,' ',0,' ',0,' ',0,'FC_EA_26_AnteckningslistaSidhuvud.sql',0,'09:18:04',0,' ',0,' ',0,' ',0,' ',0,' ',0,' ',0,' ',0,' ',0,' ',6,' ',0,0,0,0,0,1,0,0,0,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 = 8000026 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 = 8000026 and v04.dyndelsys = 2);


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


insert into ld0p0v04 
(FORMNR, FORMNAME, PREFIX, ORIENTERING, OBJEKT, VISACOMBO, TYPDOK, DYNDELSYS, ANTALCOL, PARENT, NIVA, AVSNITT, FORMLOGO, VISAITRAD, SORTERING, AVSNITTSTYP, VERSION) values (
8000026,'Journalanteckningslista sidhuvud',' ',1,7027,0,8000026,2,25,0,0,0,' ',0,0,0,0);

insert into ld0p0v05 
(FORMNR, FRAGENR, SORTERING, VERSION, SIDNUMMER, DYNDELSYS) values (
8000026,101076462,1,0,0,2);
insert into ld0p0v05 
(FORMNR, FRAGENR, SORTERING, VERSION, SIDNUMMER, DYNDELSYS) values (
8000026,101076463,2,0,0,2);
insert into ld0p0v05 
(FORMNR, FRAGENR, SORTERING, VERSION, SIDNUMMER, DYNDELSYS) values (
8000026,101076464,3,0,0,2);
insert into ld0p0v05 
(FORMNR, FRAGENR, SORTERING, VERSION, SIDNUMMER, DYNDELSYS) values (
8000026,101076465,4,0,0,2);
insert into ld0p0v05 
(FORMNR, FRAGENR, SORTERING, VERSION, SIDNUMMER, DYNDELSYS) values (
8000026,101076466,5,0,0,2);
insert into ld0p0v05 
(FORMNR, FRAGENR, SORTERING, VERSION, SIDNUMMER, DYNDELSYS) values (
8000026,101076467,6,0,0,2);

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) values (
101076463,10,5,0,19,30,0,0,'Journalanteckningar','Arial',18,6,0,0,0,1,2,0,2,7,0,' ',0,0,0,0,0,0,0,0,0,0,0,2,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) values (
101076466,3,5,0,19,30,0,0,'PERSONUPPGIFTER','Arial',14,4,0,0,0,4,2,0,1,11,0,' ',0,0,0,0,0,1,1,1,1,0,0,2,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) values (
101076466,14,5,0,19,30,0,0,'ÖVRIGA UPPGIFTER','Arial',14,4,0,0,0,4,2,0,1,11,0,' ',0,0,0,0,0,0,1,1,1,0,0,2,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) values (
101076467,3,3,0,19,30,0,0,' ','Arial',14,4,0,0,0,4,1,0,1,11,0,' ',0,7000,2,0,0,1,1,0,1,0,0,2,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) values (
101076467,14,5,0,19,30,0,0,'Typ av akt','Arial',14,4,0,0,0,4,2,0,1,5,0,' ',0,0,0,0,0,0,0,0,1,0,0,2,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) values (
101076467,19,3,0,19,30,0,0,' ','Arial',14,4,0,0,0,4,2,0,1,6,0,' ',0,7027,590,0,0,0,1,0,1,0,0,2,0,' ',0,0,0,' ',' ',0,0,' ',0, ' ', ' ');

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);

