Einzelnen Beitrag anzeigen

Walter Landwehr

Registriert seit: 28. Mär 2006
Ort: 32816 Schieder-Schwalenberg
384 Beiträge
 
Delphi 10.4 Sydney
 
#1

Systemtabellen in Firebird

  Alt 13. Okt 2022, 12:24
Hallo
ich habe hier zwei Firebird Datenbanken die eigentlich gleich sein sollten. In einer Datenbank ist ein feld mit computed (Rechnungsjahr|| '-' ||Rechnungsnummer)

In der anderen Datenbank gibt es auch dieses Feld jedoch ohne computed warum weiß ich nicht.

Wie kann man diese die Datenbanken abgleichen. Mit IB Expert geht es nicht.
Hier die Updatebefehle in IBExpert
Delphi-Quellcode:
ALTER TABLE TBL_ADRESS ALTER COLUMN NAMEKOMPLETT
  /* VARCHAR(141) */ COMPUTED BY (Vorname|| ' ' ||Name);

ALTER TABLE TBL_BUCHHALTUNG ALTER COLUMN MONAT
  /* SMALLINT */ COMPUTED BY (extract(month from BELEGDATUM));

ALTER TABLE TBL_BUCHHALTUNG ALTER COLUMN JAHR
  /* SMALLINT */ COMPUTED BY (extract(year from BELEGDATUM));

ALTER TABLE TBL_KRAEUTERKALKPOS ALTER COLUMN GESAMTPREIS
  /* DOUBLE PRECISION */ COMPUTED BY (Menge * PreisPro100/100);

ALTER TABLE TBL_KRAEUTERKALKULATION ALTER COLUMN EKPROZENTPREIS
  /* DOUBLE PRECISION */ COMPUTED BY (EKPreis * EKProzent/100);

ALTER TABLE TBL_KRAEUTERKALKULATION ALTER COLUMN EKGESAMTPREIS
  /* DOUBLE PRECISION */ COMPUTED BY (EKPreis + EKProzentPreis);

ALTER TABLE TBL_KRAEUTERKALKULATION ALTER COLUMN VKGESAMTPREIS
  /* DOUBLE PRECISION */ COMPUTED BY (EKGesamtpreis + PreisVerpackung + PreisBriefmarke + PreisUmschlag + Arbeitspreis);

ALTER TABLE TBL_KRAEUTERKALKULATION ALTER COLUMN MENGEPROTAG
  /* DOUBLE PRECISION */ COMPUTED BY (GesamtMenge/Anwendungsdauer);

ALTER TABLE TBL_LIEFERANT ALTER COLUMN ANREDE_NAME
  /* VARCHAR(106) */ COMPUTED BY (Anrede || ' ' || Name);

ALTER TABLE TBL_LIEFERANT ALTER COLUMN NAMEKOMPLETT
  /* VARCHAR(141) */ COMPUTED BY (Vorname|| ' ' ||Name);

ALTER TABLE TBL_MITARBEITER ALTER COLUMN ANREDE_NAME
  /* VARCHAR(106) */ COMPUTED BY (Anrede || ' ' || Name);

ALTER TABLE TBL_MITARBEITER ALTER COLUMN NAMEKOMPLETT
  /* VARCHAR(141) */ COMPUTED BY (Vorname|| ' ' ||Name);

ALTER TABLE TBL_PATBLATT ALTER COLUMN BEHANDLUNGSMONAT
  /* SMALLINT */ COMPUTED BY (extract(month from BEHANDLUNGSDATUM));

ALTER TABLE TBL_PATBLATT ALTER COLUMN BEHANDLUNGSJAHR
  /* SMALLINT */ COMPUTED BY (extract(year from BEHANDLUNGSDATUM));

ALTER TABLE TBL_PATIENT ALTER COLUMN NAMEKOMPLETT
  /* VARCHAR(141) */ COMPUTED BY (Vorname|| ' ' ||Name);

ALTER TABLE TBL_RECHNUNG ALTER COLUMN RECHNUNGSNUMMERKOMPLETT
  /* VARCHAR(23) */ COMPUTED BY (Rechnungsjahr|| '-' ||Rechnungsnummer);

ALTER TABLE TBL_RECHNUNG ALTER COLUMN NAMEKOMPLETT
  /* VARCHAR(107) */ COMPUTED BY (Vorname|| ' ' ||Name);

ALTER TABLE TBL_RECHNUNGSPOSITIONEN ALTER COLUMN BEHANDLUNGSMONAT
  /* SMALLINT */ COMPUTED BY (extract(month from BEHANDLUNGSDATUM));

ALTER TABLE TBL_RECHNUNGSPOSITIONEN ALTER COLUMN BEHANDLUNGSJAHR
  /* SMALLINT */ COMPUTED BY (extract(year from BEHANDLUNGSDATUM));
Beim ausführen des Update scripts kommen diese Meldungen:


/************************************************** *****************************
Die nächste Anweisung verursacht folgenden Fehler:

This operation is not defined for system tables.
unsuccessful metadata update.
Cannot add or remove COMPUTED from column NAMEKOMPLETT.
-------------------------------------------------------
SQLCODE: -607
SQLSTATE: 42000
GDSCODE: 335544351
************************************************** *****************************/
ALTER TABLE TBL_ADRESS ALTER COLUMN NAMEKOMPLETT
/* VARCHAR(141) */ COMPUTED BY (Vorname|| ' ' ||Name);

/************************************************** *****************************
Die nächste Anweisung verursacht folgenden Fehler:

This operation is not defined for system tables.
unsuccessful metadata update.
Cannot add or remove COMPUTED from column MONAT.
------------------------------------------------
SQLCODE: -607
SQLSTATE: 42000
GDSCODE: 335544351
************************************************** *****************************/
ALTER TABLE TBL_BUCHHALTUNG ALTER COLUMN MONAT
/* SMALLINT */ COMPUTED BY (extract(month from BELEGDATUM));

/************************************************** *****************************
Die nächste Anweisung verursacht folgenden Fehler:

This operation is not defined for system tables.
unsuccessful metadata update.
Cannot add or remove COMPUTED from column JAHR.
------------------------------------------------
SQLCODE: -607
SQLSTATE: 42000
GDSCODE: 335544351
************************************************** *****************************/
ALTER TABLE TBL_BUCHHALTUNG ALTER COLUMN JAHR
/* SMALLINT */ COMPUTED BY (extract(year from BELEGDATUM));

/************************************************** *****************************
Die nächste Anweisung verursacht folgenden Fehler:

This operation is not defined for system tables.
unsuccessful metadata update.
Cannot add or remove COMPUTED from column GESAMTPREIS.
------------------------------------------------------
SQLCODE: -607
SQLSTATE: 42000
GDSCODE: 335544351
************************************************** *****************************/
ALTER TABLE TBL_KRAEUTERKALKPOS ALTER COLUMN GESAMTPREIS
/* DOUBLE PRECISION */ COMPUTED BY (Menge * PreisPro100/100);

/************************************************** *****************************
Die nächste Anweisung verursacht folgenden Fehler:

This operation is not defined for system tables.
unsuccessful metadata update.
Cannot add or remove COMPUTED from column EKPROZENTPREIS.
---------------------------------------------------------
SQLCODE: -607
SQLSTATE: 42000
GDSCODE: 335544351
************************************************** *****************************/
ALTER TABLE TBL_KRAEUTERKALKULATION ALTER COLUMN EKPROZENTPREIS
/* DOUBLE PRECISION */ COMPUTED BY (EKPreis * EKProzent/100);

/************************************************** *****************************
Die nächste Anweisung verursacht folgenden Fehler:

This operation is not defined for system tables.
unsuccessful metadata update.
Cannot add or remove COMPUTED from column EKGESAMTPREIS.
--------------------------------------------------------
SQLCODE: -607
SQLSTATE: 42000
GDSCODE: 335544351
************************************************** *****************************/
ALTER TABLE TBL_KRAEUTERKALKULATION ALTER COLUMN EKGESAMTPREIS
/* DOUBLE PRECISION */ COMPUTED BY (EKPreis + EKProzentPreis);

/************************************************** *****************************
Die nächste Anweisung verursacht folgenden Fehler:

This operation is not defined for system tables.
unsuccessful metadata update.
Cannot add or remove COMPUTED from column VKGESAMTPREIS.
--------------------------------------------------------
SQLCODE: -607
SQLSTATE: 42000
GDSCODE: 335544351
************************************************** *****************************/
ALTER TABLE TBL_KRAEUTERKALKULATION ALTER COLUMN VKGESAMTPREIS
/* DOUBLE PRECISION */ COMPUTED BY (EKGesamtpreis + PreisVerpackung + PreisBriefmarke + PreisUmschlag + Arbeitspreis);

/************************************************** *****************************
Die nächste Anweisung verursacht folgenden Fehler:

This operation is not defined for system tables.
unsuccessful metadata update.
Cannot add or remove COMPUTED from column MENGEPROTAG.
------------------------------------------------------
SQLCODE: -607
SQLSTATE: 42000
GDSCODE: 335544351
************************************************** *****************************/
ALTER TABLE TBL_KRAEUTERKALKULATION ALTER COLUMN MENGEPROTAG
/* DOUBLE PRECISION */ COMPUTED BY (GesamtMenge/Anwendungsdauer);

/************************************************** *****************************
Die nächste Anweisung verursacht folgenden Fehler:

This operation is not defined for system tables.
unsuccessful metadata update.
Cannot add or remove COMPUTED from column ANREDE_NAME.
------------------------------------------------------
SQLCODE: -607
SQLSTATE: 42000
GDSCODE: 335544351
************************************************** *****************************/
ALTER TABLE TBL_LIEFERANT ALTER COLUMN ANREDE_NAME
/* VARCHAR(106) */ COMPUTED BY (Anrede || ' ' || Name);

/************************************************** *****************************
Die nächste Anweisung verursacht folgenden Fehler:

This operation is not defined for system tables.
unsuccessful metadata update.
Cannot add or remove COMPUTED from column NAMEKOMPLETT.
-------------------------------------------------------
SQLCODE: -607
SQLSTATE: 42000
GDSCODE: 335544351
************************************************** *****************************/
ALTER TABLE TBL_LIEFERANT ALTER COLUMN NAMEKOMPLETT
/* VARCHAR(141) */ COMPUTED BY (Vorname|| ' ' ||Name);

/************************************************** *****************************
Die nächste Anweisung verursacht folgenden Fehler:

This operation is not defined for system tables.
unsuccessful metadata update.
Cannot add or remove COMPUTED from column ANREDE_NAME.
------------------------------------------------------
SQLCODE: -607
SQLSTATE: 42000
GDSCODE: 335544351
************************************************** *****************************/
ALTER TABLE TBL_MITARBEITER ALTER COLUMN ANREDE_NAME
/* VARCHAR(106) */ COMPUTED BY (Anrede || ' ' || Name);

/************************************************** *****************************
Die nächste Anweisung verursacht folgenden Fehler:

This operation is not defined for system tables.
unsuccessful metadata update.
Cannot add or remove COMPUTED from column NAMEKOMPLETT.
-------------------------------------------------------
SQLCODE: -607
SQLSTATE: 42000
GDSCODE: 335544351
************************************************** *****************************/
ALTER TABLE TBL_MITARBEITER ALTER COLUMN NAMEKOMPLETT
/* VARCHAR(141) */ COMPUTED BY (Vorname|| ' ' ||Name);

/************************************************** *****************************
Die nächste Anweisung verursacht folgenden Fehler:

This operation is not defined for system tables.
unsuccessful metadata update.
Cannot add or remove COMPUTED from column BEHANDLUNGSMONAT.
-----------------------------------------------------------
SQLCODE: -607
SQLSTATE: 42000
GDSCODE: 335544351
************************************************** *****************************/
ALTER TABLE TBL_PATBLATT ALTER COLUMN BEHANDLUNGSMONAT
/* SMALLINT */ COMPUTED BY (extract(month from BEHANDLUNGSDATUM));

/************************************************** *****************************
Die nächste Anweisung verursacht folgenden Fehler:

This operation is not defined for system tables.
unsuccessful metadata update.
Cannot add or remove COMPUTED from column BEHANDLUNGSJAHR.
----------------------------------------------------------
SQLCODE: -607
SQLSTATE: 42000
GDSCODE: 335544351
************************************************** *****************************/
ALTER TABLE TBL_PATBLATT ALTER COLUMN BEHANDLUNGSJAHR
/* SMALLINT */ COMPUTED BY (extract(year from BEHANDLUNGSDATUM));

/************************************************** *****************************
Die nächste Anweisung verursacht folgenden Fehler:

This operation is not defined for system tables.
unsuccessful metadata update.
Cannot add or remove COMPUTED from column NAMEKOMPLETT.
-------------------------------------------------------
SQLCODE: -607
SQLSTATE: 42000
GDSCODE: 335544351
************************************************** *****************************/
ALTER TABLE TBL_PATIENT ALTER COLUMN NAMEKOMPLETT
/* VARCHAR(141) */ COMPUTED BY (Vorname|| ' ' ||Name);

/************************************************** *****************************
Die nächste Anweisung verursacht folgenden Fehler:

This operation is not defined for system tables.
unsuccessful metadata update.
Cannot add or remove COMPUTED from column RECHNUNGSNUMMERKOMPLETT.
------------------------------------------------------------------
SQLCODE: -607
SQLSTATE: 42000
GDSCODE: 335544351
************************************************** *****************************/
ALTER TABLE TBL_RECHNUNG ALTER COLUMN RECHNUNGSNUMMERKOMPLETT
/* VARCHAR(23) */ COMPUTED BY (Rechnungsjahr|| '-' ||Rechnungsnummer);

/************************************************** *****************************
Die nächste Anweisung verursacht folgenden Fehler:

This operation is not defined for system tables.
unsuccessful metadata update.
Cannot add or remove COMPUTED from column NAMEKOMPLETT.
-------------------------------------------------------
SQLCODE: -607
SQLSTATE: 42000
GDSCODE: 335544351
************************************************** *****************************/
ALTER TABLE TBL_RECHNUNG ALTER COLUMN NAMEKOMPLETT
/* VARCHAR(107) */ COMPUTED BY (Vorname|| ' ' ||Name);

/************************************************** *****************************
Die nächste Anweisung verursacht folgenden Fehler:

This operation is not defined for system tables.
unsuccessful metadata update.
Cannot add or remove COMPUTED from column BEHANDLUNGSMONAT.
-----------------------------------------------------------
SQLCODE: -607
SQLSTATE: 42000
GDSCODE: 335544351
************************************************** *****************************/
ALTER TABLE TBL_RECHNUNGSPOSITIONEN ALTER COLUMN BEHANDLUNGSMONAT
/* SMALLINT */ COMPUTED BY (extract(month from BEHANDLUNGSDATUM));

/************************************************** *****************************
Die nächste Anweisung verursacht folgenden Fehler:

This operation is not defined for system tables.
unsuccessful metadata update.
Cannot add or remove COMPUTED from column BEHANDLUNGSJAHR.
----------------------------------------------------------
SQLCODE: -607
SQLSTATE: 42000
GDSCODE: 335544351
************************************************** *****************************/
ALTER TABLE TBL_RECHNUNGSPOSITIONEN ALTER COLUMN BEHANDLUNGSJAHR
/* SMALLINT */ COMPUTED BY (extract(year from BEHANDLUNGSDATUM));

/************************************************** *****************************
Die nächste Anweisung verursacht folgenden Fehler:

This operation is not defined for system tables.
unsuccessful metadata update.
STORE RDB$RELATION_CONSTRAINTS failed.
attempt to store duplicate value (visible to active transactions) in unique index "RDB$INDEX_12".
Problematic key value is ("RDB$CONSTRAINT_NAME" = 'CHK_TBL_BUCHHALTUNG').
-------------------------------------------------------------------------------------------------
SQLCODE: -607
SQLSTATE: 42000
GDSCODE: 335544351
************************************************** *****************************/
ALTER TABLE TBL_BUCHHALTUNG ADD CONSTRAINT CHK_TBL_BUCHHALTUNG CHECK(((Belegnummer is not Null) and (Belegnummer >0)));

/************************************************** *****************************
Die nächste Anweisung verursacht folgenden Fehler:

This operation is not defined for system tables.
unsuccessful metadata update.
STORE RDB$RELATION_CONSTRAINTS failed.
attempt to store duplicate value (visible to active transactions) in unique index "RDB$INDEX_12".
Problematic key value is ("RDB$CONSTRAINT_NAME" = 'CHK_TBL_KASSENBUCH').
-------------------------------------------------------------------------------------------------
SQLCODE: -607
SQLSTATE: 42000
GDSCODE: 335544351
************************************************** *****************************/
ALTER TABLE TBL_KASSENBUCH ADD CONSTRAINT CHK_TBL_KASSENBUCH CHECK(((Belegnummer is not Null) and (Belegnummer >0)));

/************************************************** *****************************
Die nächste Anweisung verursacht folgenden Fehler:

This operation is not defined for system tables.
unsuccessful metadata update.
STORE RDB$RELATION_CONSTRAINTS failed.
attempt to store duplicate value (visible to active transactions) in unique index "RDB$INDEX_12".
Problematic key value is ("RDB$CONSTRAINT_NAME" = 'CHK_TBL_PAREZEPT').
-------------------------------------------------------------------------------------------------
SQLCODE: -607
SQLSTATE: 42000
GDSCODE: 335544351
************************************************** *****************************/
ALTER TABLE TBL_PAREZEPT ADD CONSTRAINT CHK_TBL_PAREZEPT CHECK((DATUM is not Null));

/************************************************** *****************************
Die nächste Anweisung verursacht folgenden Fehler:

This operation is not defined for system tables.
unsuccessful metadata update.
STORE RDB$RELATION_CONSTRAINTS failed.
attempt to store duplicate value (visible to active transactions) in unique index "RDB$INDEX_12".
Problematic key value is ("RDB$CONSTRAINT_NAME" = 'CHK_TBL_TEXTBAUSTEINE').
-------------------------------------------------------------------------------------------------
SQLCODE: -607
SQLSTATE: 42000
GDSCODE: 335544351
************************************************** *****************************/
ALTER TABLE TBL_TEXTBAUSTEINE ADD CONSTRAINT CHK_TBL_TEXTBAUSTEINE CHECK(SUCHWORT <> '');

/************************************************** *****************************
Die nächste Anweisung verursacht folgenden Fehler:

This operation is not defined for system tables.
unsuccessful metadata update.
STORE RDB$RELATION_CONSTRAINTS failed.
attempt to store duplicate value (visible to active transactions) in unique index "RDB$INDEX_12".
Problematic key value is ("RDB$CONSTRAINT_NAME" = 'CHK_TBL_TPAREZEPT').
-------------------------------------------------------------------------------------------------
SQLCODE: -607
SQLSTATE: 42000
GDSCODE: 335544351
************************************************** *****************************/
ALTER TABLE TBL_TPAREZEPT ADD CONSTRAINT CHK_TBL_TPAREZEPT CHECK((DATUM is not Null));

Hat jemand eine Idee wie ich die beiden Tabellen gleich bekomme.
Walter Landwehr
Mfg

Walter
  Mit Zitat antworten Zitat