Jump to content

Index - Firebirddatenbank


Der letzte Beitrag zu diesem Thema ist mehr als 180 Tage alt. Bitte erstelle einen neuen Beitrag zu Deiner Anfrage!

Recommended Posts

Hallo,

ich habe folgendes Skript.

 

Ich habe in einer Datenbank einen Fehler eingebaut. Die Datenbank ist eine Firebird-Datenbank.

 

Ich habe jetzt zwei Möglichkeiten.

 

In dem Verwaltungsprogramm wird ein historischer Vertrag angelegt, wenn man Änderungen vornimmt. Jetzt möchte ich das rückgängig machen, dafür müsste ich den Datensatz mit über 100 Spalten einlesen und neu erstellen. Deshalb bin ich folgenden Weg gegangen. Ich nehme die eindeutige ID des historischen Eintrags und den des aktuellen und tausche sie einfach.

Es sieht super aus in der Datenbank.

Jetzt öffne ich den Vertrag und beim öffnen scheint er die Detailmaske nicht zu finden und mein Eintrag verschwindet irreversibel aus der Datenbank und es wird ein neuer leerer Datensatz erzeugt.


Jetzt schaue ich in den DDL und den Auslösern und stoße auf:

 

CREATE INDEX VT_KFZ1 ON VT_KFZ (AMSIDNR);
CREATE INDEX VT_KFZ2 ON VT_KFZ ("KEY");

 

Also komme ich zu dem Entschluss, ich nehme den Tausch vor, ändere aber nichts im Index. Wie kann ich das machen? Ich habe ein DBEAVER und weiß gar nicht wo ich den Index finde. Der Index wird ja wohl zur schnellen Auffindbarkeit angelegt, aber ich weiß nicht wie ich den Tausch von zwei Einträgen im Index korrekt eintrage.

Könnt Ihr mir helfen?

 

Da ich Indizes in Verbindung mit SQL nicht kenne, wäre es total nett, wenn noch Infos fehlen, mir zu sagen was Ihr noch benötigt, um mir zu helfen.

 

Gruß Volker
 

Link to post

Ich lösche jedoch nichts.

 

Ich mache ein Update.

 

Ich habe eine Vertragsmaske, die besteht aus einem allgemeinen Inhalt zum Vertrag (Tabelle Vertrag). Weiterhin gibt es Details, die stehen in meinem Beispiel in Tabelle VT_KFZ.

 

Der Vertrag hat die ID 1000 und die Details haben die ID 1001. Jetzt wurde etwas geändert. Jetzt behält der Vertrag die 1000 und legt einen historischen Stand an mit der ID 2000 und im Feld Key steht die 1000. Das "alte Detail" (ID 2001) zeigt im Feld Key jetzt auf die 2000 und das neue Detail bekommt den Key 1000.

 

Jetzt mache ich folgendes im System mit JScript: Ich lade eine Selektion nach Bearbeitungsdatum und gehe die Verträge durch. Er sucht jetzt die Historie mit der 2000 und sucht das Detail (2001) welches auf die 2000 zeigt. Befüllt jetzt die Variable mit 2001. Die andere Variable befüllt er mit der aktuellen ID 1001.

 

Jetzt laufen zwei UPDATE Befehle nacheinander.

 

UPDATE VT_KFZ SET KEY ='1000' WHERE ID ='2001'
UPDATE VT_KFZ SET KEY ='2000' WHERE ID ='1001'

 

Ich will quasi die beiden Einträge tauschen. Jetzt verschwindet aber 1001 und 2001 beim Aufruf des Vertrags mit der 1000 und ein neuer Eintrag 3000 wird erstellt.

 

Also muss ich offensichtlich diesen Index-Befehl irgendow hinschicken.

 

Hier vielleicht mal das gesamte Skript:

 

//Variablenset

var gesellschaft ='HVGARTEN';
var gdvdatum = '2020-08-06';
var historie = '';
var vertragsnummer = '';
var vertrag_id = '';
var vertrag_id_historie ='';
var vt_sparte_id ='';
var vt_sparte_id_historie ='';
var sparte = 'KFZ';
var selektion = 'GES = \'' + gesellschaft + '\' AND HIS_DATUM = \'' + gdvdatum + '\' AND HIS_GRUND =\'Korrektur Vertragsanlage\' AND HISTORIE_ZU IS NOT NULL AND TYP = \'' + sparte + '\'';

//Basis-Selektion
var Dataset = Runtime.provideDataSet();

//Selektionen
//var Dataset_Vertrag = Runtime.provideDataSet();
var Dataset_Historie = Runtime.provideDataSet();
var Dataset_VT_KFZ = Runtime.provideDataSet();
var Dataset_VT_KFZ_Historie = Runtime.provideDataSet();



//Beginn des Skriptes

// 1. Schritt Aufbau der Basis-Selektion

Dataset.commandtext = "SELECT AMSIDNR FROM VERTRAG WHERE "+selektion+"";
//Runtime.MsgBox("SELECT AMSIDNR FROM VERTRAG WHERE "+selektion+"");
Dataset.active =true;

Dataset.First();

while (!Dataset.Eof)
{
	Dataset_Historie.commandtext = "SELECT * FROM VERTRAG WHERE AMSIDNR = '"+ Dataset.FindField("AMSIDNR").AsString +"'";
	Dataset_Historie.active = true;
	
	vertrag_id_historie = Dataset_Historie.FindField("AMSIDNR").AsString;
	vertrag_id = Dataset_Historie.FindField("HISTORIE_ZU").AsString;
	
	/*
	Dataset_Vertrag.commandtext = ("SELECT * FROM VERTRAG WHERE AMSIDNR = '"+vertrag_id+"'");
	Dataset_Vertrag.active = true;
	sparte = Dataset_Vertrag.FindField("TYP").AsString;
	gesellschaft = Dataset_Vertrag.FindField("GES").AsString;
	vertragsnummer = Dataset_Vertrag.FindField("VNR").AsString;
	*/
	
	Dataset_VT_KFZ.commandtext = "SELECT * FROM VT_KFZ WHERE KEY = '"+vertrag_id+"' "
	Dataset_VT_KFZ.active = true;
	vt_sparte_id = Dataset_VT_KFZ.FindField("AMSIDNR").AsString;
	
	
	
	Dataset_VT_KFZ_Historie.commandtext = "SELECT * FROM VT_KFZ WHERE KEY = '"+vertrag_id_historie+"' "
	Dataset_VT_KFZ_Historie.active = true;
	vt_sparte_id_historie = Dataset_VT_KFZ_Historie.FindField("AMSIDNR").AsString;
	
	Dataset_VT_KFZ.Edit;
	Dataset_VT_KFZ_Historie.Edit;
	
	Runtime.MsgBox(vertrag_id_historie)
	Runtime.MsgBox(vertrag_id);
	Runtime.MsgBox(vt_sparte_id);
	Runtime.MsgBox(vt_sparte_id_historie);
	
	
	Dataset_VT_KFZ.FindField("KEY").AsString = vt_sparte_id_historie;
	Dataset_VT_KFZ_Historie.FindField("KEY").AsString = vt_sparte_id;
	
	Runtime.MsgBox(vertrag_id_historie)
	Runtime.MsgBox(vertrag_id);
	Runtime.MsgBox(vt_sparte_id);
	Runtime.MsgBox(vt_sparte_id_historie);
	
	
	Dataset_VT_KFZ.Post;
	Dataset_VT_KFZ.Applyupdates(0);
	Dataset_VT_KFZ.active =false;
	
	Dataset_VT_KFZ_Historie.Post;
	Dataset_VT_KFZ_Historie.Applyupdates(0);
	Dataset_VT_KFZ_Historie.active =false;
	
	Dataset_Historie.active = false;
	//Dataset_Vertrag.active = false;
	Dataset.Next;
}

Dataset.active=false;


Runtime.MsgBox("Fertig");

 

Link to post

Aber dann verstehe ich es nicht. Wenn die Auslöser immer durchgeführt werden, dann müsste es ja funktionieren.

 

Ich habe das Gefühl, da wir das nicht mit einem SQL-Programm machen,sondern mit einem Skript im Programm, dass diese Trigger einfach nicht ausgelöst werden.

Link to post

Es gibt Auslöser im System mit unterschiedlichen Typen. AFTER INSERT OR UPDATE oder AFTER INSERT OR UPDATE OR DELETE. Diese scheint er aber nicht auszuführen.

 

Hier mal ein geschriebener Auslöser:

 

CREATE TRIGGER ASS$GS_00018 FOR VT_KFZ AFTER INSERT OR UPDATE
as
declare variable TGT_ID type of column §GLOBALSEARCH.TGT_ID;
declare variable TGT_TBL type of column $GLOBALSEARCH.TGT_TBL;
declare variable SRCH_VALUE type of column $GLOBALSEARCH.SRCH_VALUE;
begin
  select first 1 "KEY", 'VERTRAG', 
    (select RESULT from $GLOBALSEARCH_NORMALIZE(substring(coalesce(KFZ102,'') from 1 for 100))) 
  from VT_KFZ
  where IDNR = new.IDNR 
  into :TGT_ID, :TGT_TBL, :SRCH_VALUE;
  
  if (TGT_ID is not null and coalesce(SRCH_VALUE, '') <> '' and 
    (inserting or 
     updating and not exists(select * from $GLOBALSEARCH g 
       where g.FK_GLOBALSEARCH_FIELDS = 18 and g.TGT_ID = :TGT_TBL and g.TGT_TBL = :TGT_TBL and g.SRCH_VALUE = :SRCH_VALUE))) 
  then
    update or insert into $GLOBALSEARCH (FK_GLOBALSEARCH_FIELDS, SRCH_VALUE, TGT_ID, TGT_TBL)
    values (18, :SRCH_VALUE, :TGT_ID, :TGT_TBL)
    matching (FK_GLOBALSEARCH_FIELDS, TGT_ID, TGT_TBL);
end

 

Es wird also etwas in eine globale Tabelle geschrieben und dieser Schritt passiert bei mir nicht, da ich dachte ich tausche ja nur bestehende Einträge, aber ich gehe inzwischen davon aus. Das ja der alte Eintrag den ich jetzt wieder neu machen will wohl aus dieser Liste gelöscht wurde und der alte steht noch drin ist aber leer. 

 

Also muss ich diese Tabelle noch irgendwie bearbeiten, aber ich merke schon eine große Unsicherheit in dem Bereich :eye2:

Link to post

Es ist sogar viel mehr so, dass er im Zuge meines UPDATE-BEFEHLS beide Einträge löscht. Das habe ich eben beim Nachstellen erst mitbekommen. Das bedeutet doch wohl, dass der Update-Befehl einen Trigger auslöst und dieser löscht dann wohl die beiden EInträge.

 

Das muss dann wohl dieser Auslöser sein der mit dem Namen CL_VT_KFZ schon nach Clear klingt -.-

 

CREATE TRIGGER CL_VT_KFZ FOR VT_KFZ AFTER INSERT OR UPDATE OR DELETE
AS
DECLARE VARIABLE sUSER_NAME VARCHAR(15);
DECLARE VARIABLE AKTIV INTEGER;
DECLARE VARIABLE ISEVENT VARCHAR(9);
DECLARE VARIABLE REFAMSIDNR VARCHAR(15);
DECLARE VARIABLE XML VARCHAR(32000);
DECLARE VARIABLE sDESCRIPTION VARCHAR(150);
DECLARE VARIABLE sTABLEINFO VARCHAR(50);
declare variable "INSERTDATE" VARCHAR(1000);
declare variable "INSERTTIME" VARCHAR(1000);
declare variable "INSERTUSER" VARCHAR(1000);
declare variable "KFZ101" VARCHAR(1000);
declare variable "KFZ102" VARCHAR(1000);
declare variable "KFZ103" VARCHAR(1000);
declare variable "KFZ104" VARCHAR(1000);
declare variable "KFZ105" VARCHAR(1000);
declare variable "KFZ106" VARCHAR(1000);
declare variable "KFZ107" VARCHAR(1000);
declare variable "KFZ108" VARCHAR(1000);
declare variable "KFZ109" VARCHAR(1000);
declare variable "KFZ110" VARCHAR(1000);
declare variable "KFZ111" VARCHAR(1000);
declare variable "KFZ112" VARCHAR(1000);
declare variable "KFZ113" VARCHAR(1000);
declare variable "KFZ114" VARCHAR(1000);
declare variable "KFZ115" VARCHAR(1000);
declare variable "KFZ116" VARCHAR(1000);
declare variable "KFZ117" VARCHAR(1000);
declare variable "KFZ118" VARCHAR(1000);
declare variable "KFZ119" VARCHAR(1000);
declare variable "KFZ120" VARCHAR(1000);
declare variable "KFZ121" VARCHAR(1000);
declare variable "KFZ122" VARCHAR(1000);
declare variable "KFZ123" VARCHAR(1000);
declare variable "KFZ124" VARCHAR(1000);
declare variable "KFZ125" VARCHAR(1000);
declare variable "KFZ126" VARCHAR(1000);
declare variable "KFZ127" VARCHAR(1000);
declare variable "KFZ128" VARCHAR(1000);
declare variable "KFZ129" VARCHAR(1000);
declare variable "KFZ130" VARCHAR(1000);
declare variable "KFZ131" VARCHAR(1000);
declare variable "KFZ132" VARCHAR(1000);
declare variable "KFZ133" VARCHAR(1000);
declare variable "KFZ134" VARCHAR(1000);
declare variable "KFZ135" VARCHAR(1000);
declare variable "KFZ136" VARCHAR(1000);
declare variable "KFZ137" VARCHAR(1000);
declare variable "KFZ138" VARCHAR(1000);
declare variable "KFZ139" VARCHAR(1000);
declare variable "KFZ140" VARCHAR(1000);
declare variable "KFZ141" VARCHAR(1000);
declare variable "KFZ142" VARCHAR(1000);
declare variable "KFZ143" VARCHAR(1000);
declare variable "KFZ144" VARCHAR(1000);
declare variable "KFZ145" VARCHAR(1000);
declare variable "KFZ146" VARCHAR(1000);
declare variable "KFZ147" VARCHAR(1000);
declare variable "KFZ148" VARCHAR(1000);
declare variable "KFZ149" VARCHAR(1000);
declare variable "KFZ150" VARCHAR(1000);
declare variable "KFZ151" VARCHAR(1000);
declare variable "KFZ152" VARCHAR(1000);
declare variable "KFZ153" VARCHAR(1000);
declare variable "KFZ154" VARCHAR(1000);
declare variable "KFZ155" VARCHAR(1000);
declare variable "KFZ156" VARCHAR(1000);
declare variable "KFZ157" VARCHAR(1000);
declare variable "KFZ158" VARCHAR(1000);
declare variable "KFZ159" VARCHAR(1000);
declare variable "KFZ160" VARCHAR(1000);
declare variable "KFZ161" VARCHAR(1000);
declare variable "KFZ162" VARCHAR(1000);
declare variable "KFZ163" VARCHAR(1000);
declare variable "KFZ164" VARCHAR(1000);
declare variable "KFZ165" VARCHAR(1000);
declare variable "KFZ166" VARCHAR(1000);
declare variable "KFZ167" VARCHAR(1000);
declare variable "KFZ168" VARCHAR(1000);
declare variable "KFZ169" VARCHAR(1000);
declare variable "KFZ170" VARCHAR(1000);
declare variable "KFZ171" VARCHAR(1000);
declare variable "KFZ172" VARCHAR(1000);
declare variable "KFZ173" VARCHAR(1000);
declare variable "KFZ174" VARCHAR(1000);
declare variable "KFZ175" VARCHAR(1000);
declare variable "KFZ176" VARCHAR(1000);
declare variable "KFZ177" VARCHAR(1000);
declare variable "KFZ178" VARCHAR(1000);
declare variable "KFZ179" VARCHAR(1000);
declare variable "KFZ180" VARCHAR(1000);
declare variable "KFZ181" VARCHAR(1000);
declare variable "KFZ182" VARCHAR(1000);
declare variable "KFZ183" VARCHAR(1000);
declare variable "KFZ184" VARCHAR(1000);
declare variable "KFZ185" VARCHAR(1000);
declare variable "KFZ186" VARCHAR(1000);
declare variable "KFZ187" VARCHAR(1000);
declare variable "KFZ188" VARCHAR(1000);
declare variable "KFZ189" VARCHAR(1000);
declare variable "KFZ190" VARCHAR(1000);
declare variable "KFZ191" VARCHAR(1000);
declare variable "KFZ192" VARCHAR(1000);
declare variable "KFZ193" VARCHAR(1000);
declare variable "KFZ194" VARCHAR(1000);
declare variable "KFZ195" VARCHAR(1000);
declare variable "KFZ196" VARCHAR(1000);
declare variable "KFZ197" VARCHAR(1000);
declare variable "KFZ198" VARCHAR(1000);
declare variable "KFZ199" VARCHAR(1000);
declare variable "KFZ200" VARCHAR(1000);
declare variable "KFZ201" VARCHAR(1000);
declare variable "KFZ202" VARCHAR(1000);
declare variable "KFZ203" VARCHAR(1000);
declare variable "KFZ204" VARCHAR(1000);
declare variable "KFZ205" VARCHAR(1000);
declare variable "KFZ206" VARCHAR(1000);
declare variable "KFZ207" VARCHAR(1000);
declare variable "KFZ208" VARCHAR(1000);
declare variable "KFZ209" VARCHAR(1000);
declare variable "KFZ210" VARCHAR(1000);
declare variable "KFZ211" VARCHAR(1000);
declare variable "KFZ212" VARCHAR(1000);
declare variable "KFZ213" VARCHAR(1000);
declare variable "KFZ214" VARCHAR(1000);
declare variable "KFZ215" VARCHAR(1000);
declare variable "KFZ216" VARCHAR(1000);
declare variable "KFZ217" VARCHAR(1000);
declare variable "KFZ218" VARCHAR(1000);
declare variable "KFZ219" VARCHAR(1000);
declare variable "KFZ220" VARCHAR(1000);
declare variable "KFZ221" VARCHAR(1000);
declare variable "KFZ222" VARCHAR(1000);
declare variable "KFZ223" VARCHAR(1000);
declare variable "KFZ224" VARCHAR(1000);
declare variable "KFZ225" VARCHAR(1000);
declare variable "KFZ226" VARCHAR(1000);
declare variable "KFZ227" VARCHAR(1000);
declare variable "KFZ228" VARCHAR(1000);
declare variable "KFZ229" VARCHAR(1000);
declare variable "KFZ230" VARCHAR(1000);
declare variable "KFZ231" VARCHAR(1000);
declare variable "KFZ232" VARCHAR(1000);
declare variable "KFZ233" VARCHAR(1000);
declare variable "KFZ234" VARCHAR(1000);
declare variable "KFZ235" VARCHAR(1000);
declare variable "KFZ236" VARCHAR(1000);
declare variable "KFZ237" VARCHAR(1000);
declare variable "KFZ238" VARCHAR(1000);
declare variable "KFZ239" VARCHAR(1000);
declare variable "KFZ240" VARCHAR(1000);
declare variable "KFZ241" VARCHAR(1000);
declare variable "KFZ242" VARCHAR(1000);
declare variable "KFZ243" VARCHAR(1000);
declare variable "KFZ244" VARCHAR(1000);
declare variable "KFZ245" VARCHAR(1000);
declare variable "KFZ246" VARCHAR(1000);
declare variable "KFZ247" VARCHAR(1000);
declare variable "KFZ248" VARCHAR(1000);
declare variable "KFZ249" VARCHAR(1000);
declare variable "KFZ250" VARCHAR(1000);
declare variable "KFZ251" VARCHAR(1000);
declare variable "KFZ252" VARCHAR(1000);
declare variable "KFZ253" VARCHAR(1000);
declare variable "KFZ254" VARCHAR(1000);
declare variable "KFZ255" VARCHAR(1000);
declare variable "KFZ256" VARCHAR(1000);
declare variable "KFZ257" VARCHAR(1000);
declare variable "KFZ258" VARCHAR(1000);
declare variable "KFZ259" VARCHAR(1000);
declare variable "KFZ260" VARCHAR(1000);
declare variable "KFZ261" VARCHAR(1000);
declare variable "KFZ262" VARCHAR(1000);
declare variable "KFZ263" VARCHAR(1000);
declare variable "KFZ264" VARCHAR(1000);
declare variable "KFZ265" VARCHAR(1000);
declare variable "KFZ266" VARCHAR(1000);
BEGIN
SELECT COUNT(*) FROM changelog_config WHERE UPPER(TABLENAME)='VT_KFZ' INTO :aktiv;
if (aktiv > 0) then
BEGIN
if (new.bearbdat = old.bearbdat AND new.bearbzeit = old.bearbzeit) then
  sUSER_NAME = 'SYSTEM_BATCH';
else if (new.bearbeiter is null) then
  sUSER_NAME = 'SYSTEM_UNK';
else 
  sUSER_NAME = new.bearbeiter;
if (deleting) then
begin
  sUSER_NAME = 'unbekannt';
  isevent = (select cast((_ISO8859_1 X'4CF6736368656E') as varchar(9) character set ISO8859_1) from rdb$database);
  REFAMSIDNR = old.AMSIDNR;
end
else
begin
  REFAMSIDNR = new.AMSIDNR;
  if (inserting) then
    isevent = 'Neuanlage';
  else
    isevent = (select cast((_ISO8859_1 X'C46E646572756E67') as varchar(9) character set ISO8859_1) from rdb$database);
end
EXECUTE PROCEDURE CHANGELOG_DEFAULT old."INSERTDATE", new."INSERTDATE", 'D', 0, 'INSERTDATE' returning_values "INSERTDATE";
EXECUTE PROCEDURE CHANGELOG_DEFAULT old."INSERTTIME", new."INSERTTIME", 'T', 0, 'INSERTTIME' returning_values "INSERTTIME";
EXECUTE PROCEDURE CHANGELOG_DEFAULT old."INSERTUSER", new."INSERTUSER", 'C', 0, 'INSERTUSER' returning_values "INSERTUSER";
EXECUTE PROCEDURE CHANGELOG_DEFAULT old."KFZ101", new."KFZ101", 'C', 0, 'KFZ101' returning_values "KFZ101";
EXECUTE PROCEDURE CHANGELOG_DEFAULT old."KFZ102", new."KFZ102", 'C', 0, 'KFZ102' returning_values "KFZ102";
EXECUTE PROCEDURE CHANGELOG_DEFAULT old."KFZ103", new."KFZ103", 'C', 0, 'KFZ103' returning_values "KFZ103";
EXECUTE PROCEDURE CHANGELOG_DEFAULT old."KFZ104", new."KFZ104", 'D', 0, 'KFZ104' returning_values "KFZ104";
EXECUTE PROCEDURE CHANGELOG_DEFAULT old."KFZ105", new."KFZ105", 'N', 2, 'KFZ105' returning_values "KFZ105";
EXECUTE PROCEDURE CHANGELOG_DEFAULT old."KFZ106", new."KFZ106", 'C', 0, 'KFZ106' returning_values "KFZ106";
EXECUTE PROCEDURE CHANGELOG_DEFAULT old."KFZ107", new."KFZ107", 'C', 0, 'KFZ107' returning_values "KFZ107";
EXECUTE PROCEDURE CHANGELOG_DEFAULT old."KFZ108", new."KFZ108", 'C', 0, 'KFZ108' returning_values "KFZ108";
EXECUTE PROCEDURE CHANGELOG_DEFAULT old."KFZ109", new."KFZ109", 'N', 0, 'KFZ109' returning_values "KFZ109";
EXECUTE PROCEDURE CHANGELOG_DEFAULT old."KFZ110", new."KFZ110", 'N', 0, 'KFZ110' returning_values "KFZ110";
EXECUTE PROCEDURE CHANGELOG_DEFAULT old."KFZ111", new."KFZ111", 'C', 0, 'KFZ111' returning_values "KFZ111";
EXECUTE PROCEDURE CHANGELOG_DEFAULT old."KFZ112", new."KFZ112", 'C', 0, 'KFZ112' returning_values "KFZ112";
EXECUTE PROCEDURE CHANGELOG_DEFAULT old."KFZ113", new."KFZ113", 'N', 0, 'KFZ113' returning_values "KFZ113";
EXECUTE PROCEDURE CHANGELOG_DEFAULT old."KFZ114", new."KFZ114", 'C', 0, 'KFZ114' returning_values "KFZ114";
EXECUTE PROCEDURE CHANGELOG_DEFAULT old."KFZ115", new."KFZ115", 'N', 2, 'KFZ115' returning_values "KFZ115";
EXECUTE PROCEDURE CHANGELOG_DEFAULT old."KFZ116", new."KFZ116", 'N', 2, 'KFZ116' returning_values "KFZ116";
EXECUTE PROCEDURE CHANGELOG_DEFAULT old."KFZ117", new."KFZ117", 'C', 0, 'KFZ117' returning_values "KFZ117";
EXECUTE PROCEDURE CHANGELOG_DEFAULT old."KFZ118", new."KFZ118", 'N', 0, 'KFZ118' returning_values "KFZ118";
EXECUTE PROCEDURE CHANGELOG_DEFAULT old."KFZ119", new."KFZ119", 'C', 0, 'KFZ119' returning_values "KFZ119";
EXECUTE PROCEDURE CHANGELOG_DEFAULT old."KFZ120", new."KFZ120", 'N', 2, 'KFZ120' returning_values "KFZ120";
EXECUTE PROCEDURE CHANGELOG_DEFAULT old."KFZ121", new."KFZ121", 'N', 2, 'KFZ121' returning_values "KFZ121";
EXECUTE PROCEDURE CHANGELOG_DEFAULT old."KFZ122", new."KFZ122", 'C', 0, 'KFZ122' returning_values "KFZ122";
EXECUTE PROCEDURE CHANGELOG_DEFAULT old."KFZ123", new."KFZ123", 'N', 2, 'KFZ123' returning_values "KFZ123";
EXECUTE PROCEDURE CHANGELOG_DEFAULT old."KFZ124", new."KFZ124", 'N', 2, 'KFZ124' returning_values "KFZ124";
EXECUTE PROCEDURE CHANGELOG_DEFAULT old."KFZ125", new."KFZ125", 'N', 2, 'KFZ125' returning_values "KFZ125";
EXECUTE PROCEDURE CHANGELOG_DEFAULT old."KFZ126", new."KFZ126", 'N', 2, 'KFZ126' returning_values "KFZ126";
EXECUTE PROCEDURE CHANGELOG_DEFAULT old."KFZ127", new."KFZ127", 'N', 2, 'KFZ127' returning_values "KFZ127";
EXECUTE PROCEDURE CHANGELOG_DEFAULT old."KFZ128", new."KFZ128", 'C', 0, 'KFZ128' returning_values "KFZ128";
EXECUTE PROCEDURE CHANGELOG_DEFAULT old."KFZ129", new."KFZ129", 'N', 2, 'KFZ129' returning_values "KFZ129";
EXECUTE PROCEDURE CHANGELOG_DEFAULT old."KFZ130", new."KFZ130", 'N', 2, 'KFZ130' returning_values "KFZ130";
EXECUTE PROCEDURE CHANGELOG_DEFAULT old."KFZ131", new."KFZ131", 'N', 2, 'KFZ131' returning_values "KFZ131";
EXECUTE PROCEDURE CHANGELOG_DEFAULT old."KFZ132", new."KFZ132", 'N', 2, 'KFZ132' returning_values "KFZ132";
EXECUTE PROCEDURE CHANGELOG_DEFAULT old."KFZ133", new."KFZ133", 'N', 4, 'KFZ133' returning_values "KFZ133";
EXECUTE PROCEDURE CHANGELOG_DEFAULT old."KFZ134", new."KFZ134", 'N', 2, 'KFZ134' returning_values "KFZ134";
EXECUTE PROCEDURE CHANGELOG_DEFAULT old."KFZ135", new."KFZ135", 'N', 0, 'KFZ135' returning_values "KFZ135";
EXECUTE PROCEDURE CHANGELOG_DEFAULT old."KFZ136", new."KFZ136", 'C', 0, 'KFZ136' returning_values "KFZ136";
EXECUTE PROCEDURE CHANGELOG_DEFAULT old."KFZ137", new."KFZ137", 'C', 0, 'KFZ137' returning_values "KFZ137";
EXECUTE PROCEDURE CHANGELOG_DEFAULT old."KFZ138", new."KFZ138", 'C', 0, 'KFZ138' returning_values "KFZ138";
EXECUTE PROCEDURE CHANGELOG_DEFAULT old."KFZ139", new."KFZ139", 'C', 0, 'KFZ139' returning_values "KFZ139";
EXECUTE PROCEDURE CHANGELOG_DEFAULT old."KFZ140", new."KFZ140", 'C', 0, 'KFZ140' returning_values "KFZ140";
EXECUTE PROCEDURE CHANGELOG_DEFAULT old."KFZ141", new."KFZ141", 'C', 0, 'KFZ141' returning_values "KFZ141";
EXECUTE PROCEDURE CHANGELOG_DEFAULT old."KFZ142", new."KFZ142", 'C', 0, 'KFZ142' returning_values "KFZ142";
EXECUTE PROCEDURE CHANGELOG_DEFAULT old."KFZ143", new."KFZ143", 'C', 0, 'KFZ143' returning_values "KFZ143";
EXECUTE PROCEDURE CHANGELOG_DEFAULT old."KFZ144", new."KFZ144", 'N', 0, 'KFZ144' returning_values "KFZ144";
EXECUTE PROCEDURE CHANGELOG_DEFAULT old."KFZ145", new."KFZ145", 'C', 0, 'KFZ145' returning_values "KFZ145";
EXECUTE PROCEDURE CHANGELOG_DEFAULT old."KFZ146", new."KFZ146", 'D', 0, 'KFZ146' returning_values "KFZ146";
EXECUTE PROCEDURE CHANGELOG_DEFAULT old."KFZ147", new."KFZ147", 'C', 0, 'KFZ147' returning_values "KFZ147";
EXECUTE PROCEDURE CHANGELOG_DEFAULT old."KFZ148", new."KFZ148", 'C', 0, 'KFZ148' returning_values "KFZ148";
EXECUTE PROCEDURE CHANGELOG_DEFAULT old."KFZ149", new."KFZ149", 'C', 0, 'KFZ149' returning_values "KFZ149";
EXECUTE PROCEDURE CHANGELOG_DEFAULT old."KFZ150", new."KFZ150", 'C', 0, 'KFZ150' returning_values "KFZ150";
EXECUTE PROCEDURE CHANGELOG_DEFAULT old."KFZ151", new."KFZ151", 'N', 0, 'KFZ151' returning_values "KFZ151";
EXECUTE PROCEDURE CHANGELOG_DEFAULT old."KFZ152", new."KFZ152", 'N', 2, 'KFZ152' returning_values "KFZ152";
EXECUTE PROCEDURE CHANGELOG_DEFAULT old."KFZ153", new."KFZ153", 'N', 2, 'KFZ153' returning_values "KFZ153";
EXECUTE PROCEDURE CHANGELOG_DEFAULT old."KFZ154", new."KFZ154", 'N', 2, 'KFZ154' returning_values "KFZ154";
EXECUTE PROCEDURE CHANGELOG_DEFAULT old."KFZ155", new."KFZ155", 'C', 0, 'KFZ155' returning_values "KFZ155";
EXECUTE PROCEDURE CHANGELOG_DEFAULT old."KFZ156", new."KFZ156", 'N', 2, 'KFZ156' returning_values "KFZ156";
EXECUTE PROCEDURE CHANGELOG_DEFAULT old."KFZ157", new."KFZ157", 'N', 2, 'KFZ157' returning_values "KFZ157";
EXECUTE PROCEDURE CHANGELOG_DEFAULT old."KFZ158", new."KFZ158", 'C', 0, 'KFZ158' returning_values "KFZ158";
EXECUTE PROCEDURE CHANGELOG_DEFAULT old."KFZ159", new."KFZ159", 'N', 0, 'KFZ159' returning_values "KFZ159";
EXECUTE PROCEDURE CHANGELOG_DEFAULT old."KFZ160", new."KFZ160", 'N', 0, 'KFZ160' returning_values "KFZ160";
EXECUTE PROCEDURE CHANGELOG_DEFAULT old."KFZ161", new."KFZ161", 'N', 2, 'KFZ161' returning_values "KFZ161";
EXECUTE PROCEDURE CHANGELOG_DEFAULT old."KFZ162", new."KFZ162", 'N', 2, 'KFZ162' returning_values "KFZ162";
EXECUTE PROCEDURE CHANGELOG_DEFAULT old."KFZ163", new."KFZ163", 'N', 2, 'KFZ163' returning_values "KFZ163";
EXECUTE PROCEDURE CHANGELOG_DEFAULT old."KFZ164", new."KFZ164", 'N', 2, 'KFZ164' returning_values "KFZ164";
EXECUTE PROCEDURE CHANGELOG_DEFAULT old."KFZ165", new."KFZ165", 'C', 0, 'KFZ165' returning_values "KFZ165";
EXECUTE PROCEDURE CHANGELOG_DEFAULT old."KFZ166", new."KFZ166", 'C', 0, 'KFZ166' returning_values "KFZ166";
EXECUTE PROCEDURE CHANGELOG_DEFAULT old."KFZ167", new."KFZ167", 'C', 0, 'KFZ167' returning_values "KFZ167";
EXECUTE PROCEDURE CHANGELOG_DEFAULT old."KFZ168", new."KFZ168", 'C', 0, 'KFZ168' returning_values "KFZ168";
EXECUTE PROCEDURE CHANGELOG_DEFAULT old."KFZ169", new."KFZ169", 'D', 0, 'KFZ169' returning_values "KFZ169";
EXECUTE PROCEDURE CHANGELOG_DEFAULT old."KFZ170", new."KFZ170", 'C', 0, 'KFZ170' returning_values "KFZ170";
EXECUTE PROCEDURE CHANGELOG_DEFAULT old."KFZ171", new."KFZ171", 'C', 0, 'KFZ171' returning_values "KFZ171";
EXECUTE PROCEDURE CHANGELOG_DEFAULT old."KFZ172", new."KFZ172", 'C', 0, 'KFZ172' returning_values "KFZ172";
EXECUTE PROCEDURE CHANGELOG_DEFAULT old."KFZ173", new."KFZ173", 'C', 0, 'KFZ173' returning_values "KFZ173";
EXECUTE PROCEDURE CHANGELOG_DEFAULT old."KFZ174", new."KFZ174", 'C', 0, 'KFZ174' returning_values "KFZ174";
EXECUTE PROCEDURE CHANGELOG_DEFAULT old."KFZ175", new."KFZ175", 'C', 0, 'KFZ175' returning_values "KFZ175";
EXECUTE PROCEDURE CHANGELOG_DEFAULT old."KFZ176", new."KFZ176", 'D', 0, 'KFZ176' returning_values "KFZ176";
EXECUTE PROCEDURE CHANGELOG_DEFAULT old."KFZ177", new."KFZ177", 'C', 0, 'KFZ177' returning_values "KFZ177";
EXECUTE PROCEDURE CHANGELOG_DEFAULT old."KFZ178", new."KFZ178", 'D', 0, 'KFZ178' returning_values "KFZ178";
EXECUTE PROCEDURE CHANGELOG_DEFAULT old."KFZ179", new."KFZ179", 'N', 0, 'KFZ179' returning_values "KFZ179";
EXECUTE PROCEDURE CHANGELOG_DEFAULT old."KFZ180", new."KFZ180", 'N', 0, 'KFZ180' returning_values "KFZ180";
EXECUTE PROCEDURE CHANGELOG_DEFAULT old."KFZ181", new."KFZ181", 'C', 0, 'KFZ181' returning_values "KFZ181";
EXECUTE PROCEDURE CHANGELOG_DEFAULT old."KFZ182", new."KFZ182", 'C', 0, 'KFZ182' returning_values "KFZ182";
EXECUTE PROCEDURE CHANGELOG_DEFAULT old."KFZ183", new."KFZ183", 'C', 0, 'KFZ183' returning_values "KFZ183";
EXECUTE PROCEDURE CHANGELOG_DEFAULT old."KFZ184", new."KFZ184", 'N', 0, 'KFZ184' returning_values "KFZ184";
EXECUTE PROCEDURE CHANGELOG_DEFAULT old."KFZ185", new."KFZ185", 'C', 0, 'KFZ185' returning_values "KFZ185";
EXECUTE PROCEDURE CHANGELOG_DEFAULT old."KFZ186", new."KFZ186", 'C', 0, 'KFZ186' returning_values "KFZ186";
EXECUTE PROCEDURE CHANGELOG_DEFAULT old."KFZ187", new."KFZ187", 'N', 0, 'KFZ187' returning_values "KFZ187";
EXECUTE PROCEDURE CHANGELOG_DEFAULT old."KFZ188", new."KFZ188", 'N', 0, 'KFZ188' returning_values "KFZ188";
EXECUTE PROCEDURE CHANGELOG_DEFAULT old."KFZ189", new."KFZ189", 'N', 2, 'KFZ189' returning_values "KFZ189";
EXECUTE PROCEDURE CHANGELOG_DEFAULT old."KFZ190", new."KFZ190", 'C', 0, 'KFZ190' returning_values "KFZ190";
EXECUTE PROCEDURE CHANGELOG_DEFAULT old."KFZ191", new."KFZ191", 'C', 0, 'KFZ191' returning_values "KFZ191";
EXECUTE PROCEDURE CHANGELOG_DEFAULT old."KFZ192", new."KFZ192", 'C', 0, 'KFZ192' returning_values "KFZ192";
EXECUTE PROCEDURE CHANGELOG_DEFAULT old."KFZ193", new."KFZ193", 'I', 0, 'KFZ193' returning_values "KFZ193";
EXECUTE PROCEDURE CHANGELOG_DEFAULT old."KFZ194", new."KFZ194", 'I', 0, 'KFZ194' returning_values "KFZ194";
EXECUTE PROCEDURE CHANGELOG_DEFAULT old."KFZ195", new."KFZ195", 'C', 0, 'KFZ195' returning_values "KFZ195";
EXECUTE PROCEDURE CHANGELOG_DEFAULT old."KFZ196", new."KFZ196", 'D', 0, 'KFZ196' returning_values "KFZ196";
EXECUTE PROCEDURE CHANGELOG_DEFAULT old."KFZ197", new."KFZ197", 'N', 2, 'KFZ197' returning_values "KFZ197";
EXECUTE PROCEDURE CHANGELOG_DEFAULT old."KFZ198", new."KFZ198", 'N', 2, 'KFZ198' returning_values "KFZ198";
EXECUTE PROCEDURE CHANGELOG_DEFAULT old."KFZ199", new."KFZ199", 'N', 2, 'KFZ199' returning_values "KFZ199";
EXECUTE PROCEDURE CHANGELOG_DEFAULT old."KFZ200", new."KFZ200", 'N', 2, 'KFZ200' returning_values "KFZ200";
EXECUTE PROCEDURE CHANGELOG_DEFAULT old."KFZ201", new."KFZ201", 'N', 2, 'KFZ201' returning_values "KFZ201";
EXECUTE PROCEDURE CHANGELOG_DEFAULT old."KFZ202", new."KFZ202", 'L', 0, 'KFZ202' returning_values "KFZ202";
EXECUTE PROCEDURE CHANGELOG_DEFAULT old."KFZ203", new."KFZ203", 'C', 0, 'KFZ203' returning_values "KFZ203";
EXECUTE PROCEDURE CHANGELOG_DEFAULT old."KFZ204", new."KFZ204", 'C', 0, 'KFZ204' returning_values "KFZ204";
EXECUTE PROCEDURE CHANGELOG_DEFAULT old."KFZ205", new."KFZ205", 'C', 0, 'KFZ205' returning_values "KFZ205";
EXECUTE PROCEDURE CHANGELOG_DEFAULT old."KFZ206", new."KFZ206", 'C', 0, 'KFZ206' returning_values "KFZ206";
EXECUTE PROCEDURE CHANGELOG_DEFAULT old."KFZ207", new."KFZ207", 'I', 0, 'KFZ207' returning_values "KFZ207";
EXECUTE PROCEDURE CHANGELOG_DEFAULT old."KFZ208", new."KFZ208", 'I', 0, 'KFZ208' returning_values "KFZ208";
EXECUTE PROCEDURE CHANGELOG_DEFAULT old."KFZ209", new."KFZ209", 'I', 0, 'KFZ209' returning_values "KFZ209";
EXECUTE PROCEDURE CHANGELOG_DEFAULT old."KFZ210", new."KFZ210", 'I', 0, 'KFZ210' returning_values "KFZ210";
EXECUTE PROCEDURE CHANGELOG_DEFAULT old."KFZ211", new."KFZ211", 'I', 0, 'KFZ211' returning_values "KFZ211";
EXECUTE PROCEDURE CHANGELOG_DEFAULT old."KFZ212", new."KFZ212", 'I', 0, 'KFZ212' returning_values "KFZ212";
EXECUTE PROCEDURE CHANGELOG_DEFAULT old."KFZ213", new."KFZ213", 'C', 0, 'KFZ213' returning_values "KFZ213";
EXECUTE PROCEDURE CHANGELOG_DEFAULT old."KFZ214", new."KFZ214", 'C', 0, 'KFZ214' returning_values "KFZ214";
EXECUTE PROCEDURE CHANGELOG_DEFAULT old."KFZ215", new."KFZ215", 'C', 0, 'KFZ215' returning_values "KFZ215";
EXECUTE PROCEDURE CHANGELOG_DEFAULT old."KFZ216", new."KFZ216", 'C', 0, 'KFZ216' returning_values "KFZ216";
EXECUTE PROCEDURE CHANGELOG_DEFAULT old."KFZ217", new."KFZ217", 'C', 0, 'KFZ217' returning_values "KFZ217";
EXECUTE PROCEDURE CHANGELOG_DEFAULT old."KFZ218", new."KFZ218", 'C', 0, 'KFZ218' returning_values "KFZ218";
EXECUTE PROCEDURE CHANGELOG_DEFAULT old."KFZ219", new."KFZ219", 'C', 0, 'KFZ219' returning_values "KFZ219";
EXECUTE PROCEDURE CHANGELOG_DEFAULT old."KFZ220", new."KFZ220", 'C', 0, 'KFZ220' returning_values "KFZ220";
EXECUTE PROCEDURE CHANGELOG_DEFAULT old."KFZ221", new."KFZ221", 'C', 0, 'KFZ221' returning_values "KFZ221";
EXECUTE PROCEDURE CHANGELOG_DEFAULT old."KFZ222", new."KFZ222", 'C', 0, 'KFZ222' returning_values "KFZ222";
EXECUTE PROCEDURE CHANGELOG_DEFAULT old."KFZ223", new."KFZ223", 'C', 0, 'KFZ223' returning_values "KFZ223";
EXECUTE PROCEDURE CHANGELOG_DEFAULT old."KFZ224", new."KFZ224", 'D', 0, 'KFZ224' returning_values "KFZ224";
EXECUTE PROCEDURE CHANGELOG_DEFAULT old."KFZ225", new."KFZ225", 'D', 0, 'KFZ225' returning_values "KFZ225";
EXECUTE PROCEDURE CHANGELOG_DEFAULT old."KFZ226", new."KFZ226", 'C', 0, 'KFZ226' returning_values "KFZ226";
EXECUTE PROCEDURE CHANGELOG_DEFAULT old."KFZ227", new."KFZ227", 'C', 0, 'KFZ227' returning_values "KFZ227";
EXECUTE PROCEDURE CHANGELOG_DEFAULT old."KFZ228", new."KFZ228", 'C', 0, 'KFZ228' returning_values "KFZ228";
EXECUTE PROCEDURE CHANGELOG_DEFAULT old."KFZ229", new."KFZ229", 'D', 0, 'KFZ229' returning_values "KFZ229";
EXECUTE PROCEDURE CHANGELOG_DEFAULT old."KFZ230", new."KFZ230", 'D', 0, 'KFZ230' returning_values "KFZ230";
EXECUTE PROCEDURE CHANGELOG_DEFAULT old."KFZ231", new."KFZ231", 'C', 0, 'KFZ231' returning_values "KFZ231";
EXECUTE PROCEDURE CHANGELOG_DEFAULT old."KFZ232", new."KFZ232", 'C', 0, 'KFZ232' returning_values "KFZ232";
EXECUTE PROCEDURE CHANGELOG_DEFAULT old."KFZ233", new."KFZ233", 'C', 0, 'KFZ233' returning_values "KFZ233";
EXECUTE PROCEDURE CHANGELOG_DEFAULT old."KFZ234", new."KFZ234", 'D', 0, 'KFZ234' returning_values "KFZ234";
EXECUTE PROCEDURE CHANGELOG_DEFAULT old."KFZ235", new."KFZ235", 'D', 0, 'KFZ235' returning_values "KFZ235";
EXECUTE PROCEDURE CHANGELOG_DEFAULT old."KFZ236", new."KFZ236", 'C', 0, 'KFZ236' returning_values "KFZ236";
EXECUTE PROCEDURE CHANGELOG_DEFAULT old."KFZ237", new."KFZ237", 'C', 0, 'KFZ237' returning_values "KFZ237";
EXECUTE PROCEDURE CHANGELOG_DEFAULT old."KFZ238", new."KFZ238", 'C', 0, 'KFZ238' returning_values "KFZ238";
EXECUTE PROCEDURE CHANGELOG_DEFAULT old."KFZ239", new."KFZ239", 'D', 0, 'KFZ239' returning_values "KFZ239";
EXECUTE PROCEDURE CHANGELOG_DEFAULT old."KFZ240", new."KFZ240", 'D', 0, 'KFZ240' returning_values "KFZ240";
EXECUTE PROCEDURE CHANGELOG_DEFAULT old."KFZ241", new."KFZ241", 'C', 0, 'KFZ241' returning_values "KFZ241";
EXECUTE PROCEDURE CHANGELOG_DEFAULT old."KFZ242", new."KFZ242", 'C', 0, 'KFZ242' returning_values "KFZ242";
EXECUTE PROCEDURE CHANGELOG_DEFAULT old."KFZ243", new."KFZ243", 'C', 0, 'KFZ243' returning_values "KFZ243";
EXECUTE PROCEDURE CHANGELOG_DEFAULT old."KFZ244", new."KFZ244", 'D', 0, 'KFZ244' returning_values "KFZ244";
EXECUTE PROCEDURE CHANGELOG_DEFAULT old."KFZ245", new."KFZ245", 'D', 0, 'KFZ245' returning_values "KFZ245";
EXECUTE PROCEDURE CHANGELOG_DEFAULT old."KFZ246", new."KFZ246", 'C', 0, 'KFZ246' returning_values "KFZ246";
EXECUTE PROCEDURE CHANGELOG_DEFAULT old."KFZ247", new."KFZ247", 'C', 0, 'KFZ247' returning_values "KFZ247";
EXECUTE PROCEDURE CHANGELOG_DEFAULT old."KFZ248", new."KFZ248", 'C', 0, 'KFZ248' returning_values "KFZ248";
EXECUTE PROCEDURE CHANGELOG_DEFAULT old."KFZ249", new."KFZ249", 'C', 0, 'KFZ249' returning_values "KFZ249";
EXECUTE PROCEDURE CHANGELOG_DEFAULT old."KFZ250", new."KFZ250", 'N', 2, 'KFZ250' returning_values "KFZ250";
EXECUTE PROCEDURE CHANGELOG_DEFAULT old."KFZ251", new."KFZ251", 'C', 0, 'KFZ251' returning_values "KFZ251";
EXECUTE PROCEDURE CHANGELOG_DEFAULT old."KFZ252", new."KFZ252", 'C', 0, 'KFZ252' returning_values "KFZ252";
EXECUTE PROCEDURE CHANGELOG_DEFAULT old."KFZ253", new."KFZ253", 'C', 0, 'KFZ253' returning_values "KFZ253";
EXECUTE PROCEDURE CHANGELOG_DEFAULT old."KFZ254", new."KFZ254", 'C', 0, 'KFZ254' returning_values "KFZ254";
EXECUTE PROCEDURE CHANGELOG_DEFAULT old."KFZ255", new."KFZ255", 'C', 0, 'KFZ255' returning_values "KFZ255";
EXECUTE PROCEDURE CHANGELOG_DEFAULT old."KFZ256", new."KFZ256", 'C', 0, 'KFZ256' returning_values "KFZ256";
EXECUTE PROCEDURE CHANGELOG_DEFAULT old."KFZ257", new."KFZ257", 'C', 0, 'KFZ257' returning_values "KFZ257";
EXECUTE PROCEDURE CHANGELOG_DEFAULT old."KFZ258", new."KFZ258", 'C', 0, 'KFZ258' returning_values "KFZ258";
EXECUTE PROCEDURE CHANGELOG_DEFAULT old."KFZ259", new."KFZ259", 'C', 0, 'KFZ259' returning_values "KFZ259";
EXECUTE PROCEDURE CHANGELOG_DEFAULT old."KFZ260", new."KFZ260", 'C', 0, 'KFZ260' returning_values "KFZ260";
EXECUTE PROCEDURE CHANGELOG_DEFAULT old."KFZ261", new."KFZ261", 'C', 0, 'KFZ261' returning_values "KFZ261";
EXECUTE PROCEDURE CHANGELOG_DEFAULT old."KFZ262", new."KFZ262", 'C', 0, 'KFZ262' returning_values "KFZ262";
EXECUTE PROCEDURE CHANGELOG_DEFAULT old."KFZ263", new."KFZ263", 'C', 0, 'KFZ263' returning_values "KFZ263";
EXECUTE PROCEDURE CHANGELOG_DEFAULT old."KFZ264", new."KFZ264", 'C', 0, 'KFZ264' returning_values "KFZ264";
EXECUTE PROCEDURE CHANGELOG_DEFAULT old."KFZ265", new."KFZ265", 'C', 0, 'KFZ265' returning_values "KFZ265";
EXECUTE PROCEDURE CHANGELOG_DEFAULT old."KFZ266", new."KFZ266", 'C', 0, 'KFZ266' returning_values "KFZ266";

 XML = '<CHANGES>';
 XML = XML||"INSERTDATE"||"INSERTTIME"||"INSERTUSER"||"KFZ101"||"KFZ102"||"KFZ103"||"KFZ104"||"KFZ105"||"KFZ106"||"KFZ107"||"KFZ108"||"KFZ109"||"KFZ110"||"KFZ111"||"KFZ112"||"KFZ113"||"KFZ114"||"KFZ115"||"KFZ116"||"KFZ117";
 XML = XML||"KFZ118"||"KFZ119"||"KFZ120"||"KFZ121"||"KFZ122"||"KFZ123"||"KFZ124"||"KFZ125"||"KFZ126"||"KFZ127"||"KFZ128"||"KFZ129"||"KFZ130"||"KFZ131"||"KFZ132"||"KFZ133"||"KFZ134"||"KFZ135"||"KFZ136"||"KFZ137";
 XML = XML||"KFZ138"||"KFZ139"||"KFZ140"||"KFZ141"||"KFZ142"||"KFZ143"||"KFZ144"||"KFZ145"||"KFZ146"||"KFZ147"||"KFZ148"||"KFZ149"||"KFZ150"||"KFZ151"||"KFZ152"||"KFZ153"||"KFZ154"||"KFZ155"||"KFZ156"||"KFZ157";
 XML = XML||"KFZ158"||"KFZ159"||"KFZ160"||"KFZ161"||"KFZ162"||"KFZ163"||"KFZ164"||"KFZ165"||"KFZ166"||"KFZ167"||"KFZ168"||"KFZ169"||"KFZ170"||"KFZ171"||"KFZ172"||"KFZ173"||"KFZ174"||"KFZ175"||"KFZ176"||"KFZ177";
 XML = XML||"KFZ178"||"KFZ179"||"KFZ180"||"KFZ181"||"KFZ182"||"KFZ183"||"KFZ184"||"KFZ185"||"KFZ186"||"KFZ187"||"KFZ188"||"KFZ189"||"KFZ190"||"KFZ191"||"KFZ192"||"KFZ193"||"KFZ194"||"KFZ195"||"KFZ196"||"KFZ197";
 XML = XML||"KFZ198"||"KFZ199"||"KFZ200"||"KFZ201"||"KFZ202"||"KFZ203"||"KFZ204"||"KFZ205"||"KFZ206"||"KFZ207"||"KFZ208"||"KFZ209"||"KFZ210"||"KFZ211"||"KFZ212"||"KFZ213"||"KFZ214"||"KFZ215"||"KFZ216"||"KFZ217";
 XML = XML||"KFZ218"||"KFZ219"||"KFZ220"||"KFZ221"||"KFZ222"||"KFZ223"||"KFZ224"||"KFZ225"||"KFZ226"||"KFZ227"||"KFZ228"||"KFZ229"||"KFZ230"||"KFZ231"||"KFZ232"||"KFZ233"||"KFZ234"||"KFZ235"||"KFZ236"||"KFZ237";
 XML = XML||"KFZ238"||"KFZ239"||"KFZ240"||"KFZ241"||"KFZ242"||"KFZ243"||"KFZ244"||"KFZ245"||"KFZ246"||"KFZ247"||"KFZ248"||"KFZ249"||"KFZ250"||"KFZ251"||"KFZ252"||"KFZ253"||"KFZ254"||"KFZ255"||"KFZ256"||"KFZ257";
 XML = XML||"KFZ258"||"KFZ259"||"KFZ260"||"KFZ261"||"KFZ262"||"KFZ263"||"KFZ264"||"KFZ265"||"KFZ266"||'</CHANGES>';
  sDESCRIPTION=(select cast((_ISO8859_1 X'6E696368742076657266FC67626172') as varchar(150) character set ISO8859_1) from rdb$database);
 sTABLEINFO=(select cast((_ISO8859_1 X'5370617274656E646174656E204B465A') as varchar(150) character set ISO8859_1) from rdb$database);
 if (XML != '<CHANGES></CHANGES>') then
INSERT INTO CHANGELOG (CHANGELOGID, BEARBDAT, BEARBZEIT, BEARBEITER, DESCRIPTION, TABLENAME, TABLENAME_DISP, "KEY", STATUSEVENT, CHANGES) VALUES (gen_id(CHANGELOG_ID, 1), current_date, current_time, :sUSER_NAME, :sDESCRIPTION ,'VT_KFZ', :sTABLEINFO ,:refAMSIDNR, :isEvent ,:XML);
 WHEN SQLCODE -802 DO
 begin
  sDESCRIPTION=(select cast((_ISO8859_1 X'DC6265726C6175666665686C6572') as varchar(150) character set ISO8859_1) from rdb$database);
INSERT INTO CHANGELOG (CHANGELOGID, BEARBDAT, BEARBZEIT, BEARBEITER, DESCRIPTION, TABLENAME, TABLENAME_DISP, "KEY", STATUSEVENT, CHANGES) VALUES (gen_id(CHANGELOG_ID, 1), current_date, current_time, :sUSER_NAME, :sDESCRIPTION, 'VT_KFZ', :sTABLEINFO, :refAMSIDNR, 'Fehler', '<ERROR>CONCAT_OVERFLOW</ERROR>');
 end
end
end

 

 

Jetzt sieht man aber auch das diese Tabelle über 100 Spalten hat. Und ich möchte ungern ein Skript schreiben in dem ich alle Spalten namentlich einzeln als Variablen deklariere einlese und dann über INSERT INTO reinschreibe. Ich muss ja nicht die KEYS updaten, wenn es einen besseren Weg gibt den Inhalt eines Eintrags einfach zu kopieren. Müsste dem dann ja nur eine neue ID verpassen

Link to post
Der letzte Beitrag zu diesem Thema ist mehr als 180 Tage alt. Bitte erstelle einen neuen Beitrag zu Deiner Anfrage!

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...