![]() |
Datenbank: Firebird • Version: 2.1 • Zugriff über: IBExpert
MySQL- SQL-Script funktioniert nicht in Firebird
Hallo zusammen,
ich beschäftige mich momentan "etwas" mit DB... Dazu habe ich ein Projekt aufgegriffen ( ![]() Nun habe ich mich damit schon etwas länger befasst (und will auch weitermachen), finde aber nichts, warum folgender MySQL-Sript als Firebird-SQL-Script ab der 3. Zeile nicht funktioniert:
SQL-Code:
Es kommt folgende Fehlermeldung:
create table geodb_hierarchies (
loc_id integer not null references geodb_locations, level integer not null check (level>0 and level<=9), id_lvl1 integer not null, id_lvl2 integer, id_lvl3 integer, id_lvl4 integer, id_lvl5 integer, id_lvl6 integer, id_lvl7 integer, id_lvl8 integer, id_lvl9 integer, valid_since date, date_type_since integer, valid_until date not null, date_type_until integer not null check ( ( (level = 1 and /* loc_id = id_lvl1 and */ id_lvl2 is null and id_lvl3 is null and id_lvl4 is null and id_lvl5 is null and id_lvl6 is null and id_lvl7 is null and id_lvl8 is null and id_lvl9 is null) or (level = 2 and /* loc_id = id_lvl2 and */ id_lvl1 is not null and id_lvl3 is null and id_lvl4 is null and id_lvl5 is null and id_lvl6 is null and id_lvl7 is null and id_lvl8 is null and id_lvl9 is null) or (level = 3 and /* loc_id = id_lvl3 and */ id_lvl1 is not null and id_lvl2 is not null and id_lvl4 is null and id_lvl5 is null and id_lvl6 is null and id_lvl7 is null and id_lvl8 is null and id_lvl9 is null) or (level = 4 and /* loc_id = id_lvl4 and */ id_lvl1 is not null and id_lvl2 is not null and id_lvl3 is not null and id_lvl5 is null and id_lvl6 is null and id_lvl7 is null and id_lvl8 is null and id_lvl9 is null) or (level = 5 and /* loc_id = id_lvl5 and */ id_lvl1 is not null and id_lvl2 is not null and id_lvl3 is not null and id_lvl4 is not null and id_lvl6 is null and id_lvl7 is null and id_lvl8 is null and id_lvl9 is null) or (level = 6 and /* loc_id = id_lvl6 and */ id_lvl1 is not null and id_lvl2 is not null and id_lvl3 is not null and id_lvl4 is not null and id_lvl5 is not null and id_lvl7 is null and id_lvl8 is null and id_lvl9 is null) or (level = 7 and /* loc_id = id_lvl7 and */ id_lvl1 is not null and id_lvl2 is not null and id_lvl3 is not null and id_lvl4 is not null and id_lvl5 is not null and id_lvl6 is not null and id_lvl8 is null and id_lvl9 is null) or (level = 8 and /* loc_id = id_lvl8 and */ id_lvl1 is not null and id_lvl2 is not null and id_lvl3 is not null and id_lvl4 is not null and id_lvl5 is not null and id_lvl6 is not null and id_lvl7 is not null and id_lvl9 is null) or (level = 9 and /* loc_id = id_lvl9 and */ id_lvl1 is not null and id_lvl2 is not null and id_lvl3 is not null and id_lvl4 is not null and id_lvl5 is not null and id_lvl6 is not null and id_lvl7 is not null and id_lvl8 is not null) ) and ( (valid_since is null and date_type_since is null) or (valid_since is not null and date_type_since is not null) ) ) ) Zitat:
Ich denke hier ist eine Anpassung an die Firebird Syntax notwendig. Völlig unklar ist mir, was "level" zu besagen hat und der Zusammenahng zu "check"... :gruebel: Über Hilfe würde ich mich freuen. Und habt bitte Nachsehen, ich stehe erst gaaanz am Anfang... :oops: |
Re: MySQL- SQL-Script funktioniert nicht in Firebird
Er scheint die 2. Zeile nicht so zu nehmen. Definiere die Constraints mal extra
|
Re: MySQL- SQL-Script funktioniert nicht in Firebird
Außerdem ist level wohl ein
![]() |
Re: MySQL- SQL-Script funktioniert nicht in Firebird
Zitat:
|
Re: MySQL- SQL-Script funktioniert nicht in Firebird
Ich würde auch id_level daraus machen, das ist IMHO besser als quoten.
|
Re: MySQL- SQL-Script funktioniert nicht in Firebird
Hallo,
Bingo, "Level" ist in FB ein reserviertes Wort! :thumb: Ich hatte das auch schon geändert, hatte dann aber noch weitere Fehler, so dass ich auf diesen Schluss nicht gekommen bin. Danke Euch beiden! |
Alle Zeitangaben in WEZ +1. Es ist jetzt 10:02 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz