Autor Beitrag
foxy
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 814

Ubuntu, Gentoo
C++, PHP, Java, Ruby, Perl (Eclipse)
BeitragVerfasst: Mo 12.05.03 08:13 
guden all hab von jmd. ein bespiel skript für meine db bekommen... da
ich bald am verzweifeln bin , was einige hier scho wissen ;)
versuchte ich eben das skript so umzubauen, das es auf meine db past

ausblenden volle Höhe Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
SET SQL DIALECT 3;

  
CREATE DATABASE 'C:\Projekt2\Db\firma3.gdb'
  PAGE_SIZE 4096
  USER 'sysdba'
  PASSWORD 'masterkey'
   DEFAULT CHARACTER SET ISO8859_1;

CREATE DOMAIN TKBEZ AS VARCHAR(40) CHARACTER SET ISO8859_1 COLLATE DE_DE;      
CREATE DOMAIN TMEMO AS BLOB SUB_TYPE TEXT SEGMENT SIZE 80 CHARACTER SET ISO8859_1;  
CREATE DOMAIN TBOOLEAN AS CHAR(1) DEFAULT 'F' NOT NULL CHECK (VALUE IN ('F', 'W'));  
CREATE DOMAIN TCURRENCY AS NUMERIC(9,4) DEFAULT 0;                  

/* Tabellen */
CREATE TABLE FIRMEN (
  ID    INTEGER NOT NULL,  
  Firma    TKBEZ,        ANGEBOTE    TBOOLEAN,  
            
  PRIMARY KEY (ID));
  
CREATE TABLE ANGEBOTE (
  CODE    VARCHAR(20) NOT NULL,  
        ID    INTEGER,      
        Firma  TKBEZ,
        Standort  TKBEZ,
        Adresse            TKBEZ,
        TelNr    TKBEZ,
        PRIMARY KEY (CODE));

CREATE TABLE ANPOSTEN (
  CODE    VARCHAR(20) NOT NULL,  
  AP_LFD    INTEGER NOT NULL,    
  Angebot         TKBEZ,          PRIMARY KEY (CODE, AP_LFD));

ALTER TABLE ANGEBOTE
  ADD CONSTRAINT FK_ANGEBOTE_FIRMEN
  FOREIGN KEY (ID) REFERENCES FIRMEN (ID)
  ON UPDATE CASCADE
  ON DELETE CASCADE;
  
ALTER TABLE ANPOSTEN
  ADD CONSTRAINT FK_ANPOSTEN_ANGEBOTE
  FOREIGN KEY (CODE) REFERENCES ANGEBOTE (CODE)
  ON UPDATE CASCADE
  ON DELETE CASCADE;
  
/*Generatoren--------------------------------------------------------------------------------------*/
CREATE GENERATOR GEN_ID; 

/*Prozeduren---------------------------------------------------------------------------------------*/
SET TERM ^ ;

   AN_ANGEBOTE im Firmensatz auf 'W' gesetzt. */
CREATE TRIGGER ANGEBOT_A_I FOR ANGEBOTE AFTER INSERT
AS
BEGIN
  UPDATE FIRMEN SET ANGEBOTE = 'W' WHERE FIRMEN.ID = new.ID;
END ^

   
CREATE TRIGGER ANGEBOT_A_D FOR ANGEBOTE AFTER DELETE
AS
  DECLARE VARIABLE CNT INTEGER;
BEGIN
  SELECT COUNT(*) FROM ANGEBOTE WHERE ID = old.ID INTO CNT;
  IF (CNT = 0) THEN
    UPDATE FIRMEN SET ANGEBOTE = 'F' WHERE  FIRMEN.ID = OLD.ID;
  ELSE
    UPDATE FIRMEN SET ANGEBOTE = 'W' WHERE  FIRMEN.ID = OLD.ID;
END ^


SET TERM ; ^


so das iss das skript
der fehler heist

Dynamic SQL Error
SQL Error Code = -104
Token unknown - line1,char 17
GEN_UD on line 64; Create GEnerator GEN_ID


watt iss datt ?? :shock:
also die befehle stimmen hab ich scho nachgelesen aber ka

_________________
"Only wimps use tape backup: real men just upload their important stuff on ftp, and let the rest of the world mirror it." (Linus Torvalds)
OperatingSystem Laptop (Ubuntu Hardy)
Udontknow
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2596

Win7
D2006 WIN32, .NET (C#)
BeitragVerfasst: Mo 12.05.03 08:23 
Hi!

"GEN_ID" ist ein Schlüsselwort für IB (Funktion zum Ermitteln und impliziten Erhöhen eines Generatorwertes). Nimm einen anderen Namen für den Generator.

Cu, :)
Udontknow
foxy Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 814

Ubuntu, Gentoo
C++, PHP, Java, Ruby, Perl (Eclipse)
BeitragVerfasst: Mo 12.05.03 08:25 
dank dir
ich versuchs ... wenns nich klappt meld ich mich nomma ;)

EDIt:

also habs versucht ja der fehler iss weg nu kommt ein neuer :D

und zwar

Invalid transaction handle( expecting explicit transaction start) on line 12:
CREATE DOMAIN TKBEZ .....

wasn das nu scho wieder ... ey ich hasse es :/

_________________
"Only wimps use tape backup: real men just upload their important stuff on ftp, and let the rest of the world mirror it." (Linus Torvalds)
OperatingSystem Laptop (Ubuntu Hardy)
foxy Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 814

Ubuntu, Gentoo
C++, PHP, Java, Ruby, Perl (Eclipse)
BeitragVerfasst: Mo 12.05.03 09:23 
weis datt keiner :?

anders erstellt der nich meine db :autsch:

_________________
"Only wimps use tape backup: real men just upload their important stuff on ftp, and let the rest of the world mirror it." (Linus Torvalds)
OperatingSystem Laptop (Ubuntu Hardy)
Udontknow
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2596

Win7
D2006 WIN32, .NET (C#)
BeitragVerfasst: Mo 12.05.03 10:02 
Locker bleiben! Manche warten mehrere Tage auf eine Antwort... :wink:

Was nutzt du, um das Script zu starten? Ich nehme den IB-Expert, der scheint automatisch eine Transaktion dafür zu starten.

Probiere mal folgendes:
ausblenden Quelltext
1:
2:
3:
4:
5:
set transaction;
...
/*Hier deine Befehle*/
...
commit;


Cu,
Udontknow
foxy Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 814

Ubuntu, Gentoo
C++, PHP, Java, Ruby, Perl (Eclipse)
BeitragVerfasst: Mo 12.05.03 11:05 
die IBConsole verwende ich ...

also ganz oben set Transaction;

und ganz untern commit;
??
hab ich das so richtig verstanden und dazwischen kommt create database etc.

_________________
"Only wimps use tape backup: real men just upload their important stuff on ftp, and let the rest of the world mirror it." (Linus Torvalds)
OperatingSystem Laptop (Ubuntu Hardy)
foxy Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 814

Ubuntu, Gentoo
C++, PHP, Java, Ruby, Perl (Eclipse)
BeitragVerfasst: Mo 12.05.03 11:22 
ok habs versucht ohne erfolg

wenn ich das so mache wie du das gesagt hast, dann kommt

"Parsing Error invalid statement : SET TRANSACTION;"

hmmm ... ich weis nich weiter... und den ibexperten hab i net

_________________
"Only wimps use tape backup: real men just upload their important stuff on ftp, and let the rest of the world mirror it." (Linus Torvalds)
OperatingSystem Laptop (Ubuntu Hardy)
Udontknow
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2596

Win7
D2006 WIN32, .NET (C#)
BeitragVerfasst: Mo 12.05.03 11:23 
Das CreateDatabase-Statement sollte davor stehen. Sonst wüsste ich nicht, auf welcher DB er dann eine Transaktion starten will... :wink:
foxy Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 814

Ubuntu, Gentoo
C++, PHP, Java, Ruby, Perl (Eclipse)
BeitragVerfasst: Mo 12.05.03 11:24 
ja hab beides ausprobiert beides kommt der fehler

_________________
"Only wimps use tape backup: real men just upload their important stuff on ftp, and let the rest of the world mirror it." (Linus Torvalds)
OperatingSystem Laptop (Ubuntu Hardy)
Udontknow
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2596

Win7
D2006 WIN32, .NET (C#)
BeitragVerfasst: Mo 12.05.03 11:24 
Besorg dir den IB-Expert, der ist für Schüler & Student umsonst zu erhalten. Es erleichtert einem echt die Arbeit mit IB-Datenbanken.

Cu,
Udontknow
foxy Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 814

Ubuntu, Gentoo
C++, PHP, Java, Ruby, Perl (Eclipse)
BeitragVerfasst: Mo 12.05.03 11:26 
kann man das downloaden oder muss ich das bestellen?

_________________
"Only wimps use tape backup: real men just upload their important stuff on ftp, and let the rest of the world mirror it." (Linus Torvalds)
OperatingSystem Laptop (Ubuntu Hardy)
hansa
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 3079
Erhaltene Danke: 9



BeitragVerfasst: Mo 12.05.03 11:38 
Hi foxy,

das Script läuft einwandfrei und das mit dem IB-expert hab ich Dir vor längerer Zeit doch auch schon gesagt, oder? Und, daß Du auf Lemmys Seiten gucken sollst, da ist ein Tuto von mir. Extra für solche und ähnliche Fälle. Da steht auch der Download.

Nur, das hier:

ausblenden Quelltext
1:
CREATE GENERATOR GEN_ID;					


Das geht natürlich nicht ! GEN_ID ist ein Schlüsselwort. Das habe ich geändert und schwupps, da war die DB da.

hier ist das Tuto : www.delphi-tutorials.de

_________________
Gruß
Hansa


Zuletzt bearbeitet von hansa am Mo 12.05.03 12:16, insgesamt 1-mal bearbeitet
Udontknow
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2596

Win7
D2006 WIN32, .NET (C#)
BeitragVerfasst: Mo 12.05.03 11:44 
@Foxy:
Du musst da wohl eine Lizenz ordern, aber die ist kostenlos.

Cu,
Udontknow
CenBells
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 1547

Win 7
Delphi XE5 Pro
BeitragVerfasst: Mo 12.05.03 12:09 
ibexpert lässt sich einfach downloaden. man brauch nix zu bestellen...

Gruß
Ken
foxy Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 814

Ubuntu, Gentoo
C++, PHP, Java, Ruby, Perl (Eclipse)
BeitragVerfasst: Mo 12.05.03 12:22 
jo ok ok hab alles .. :) dank euch *gg*
und mit IBExperte geht das auch O_o nur wiso nich mit ibconsole :?

nur jetzt weis ich nicht ob es an dem skript liegt oder ob ich einfach was übersehen habe

der sagt immer wenn ich mein programm starte das feld ID wurde nicht gefunden ... ich hab aber alles umgeändert in minem programm alle datasources richtig gemacht die verbindungen von den DBFeldern richtig gemacht die abfragen alles und das kommt imma noch .... iss da vielleicht ein fehler im skript?? O_o

oder hansa ?? kann ich dir ma heute mittag wenn ich daheim bin mal proggi mit db schicken .... das du dir das ma ankuckst wenn du die woche zeit hast

_________________
"Only wimps use tape backup: real men just upload their important stuff on ftp, and let the rest of the world mirror it." (Linus Torvalds)
OperatingSystem Laptop (Ubuntu Hardy)
hansa
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 3079
Erhaltene Danke: 9



BeitragVerfasst: Mo 12.05.03 12:35 
oohhh, Du machst doch sowieso was Du willst. :lol: Dann schick mir das Ding, bevor der Strick fällig ist. 8)

_________________
Gruß
Hansa