Autor Beitrag
csigg
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 706

WIn XP, Win NT, Win2000, Suse8.0
Delphi 5, Delphi 6
BeitragVerfasst: Mi 20.07.05 14:37 
ich will in meiner IB 6 folgenden Code ausführen:
ausblenden Quelltext
1:
2:
3:
4:
5:
6:
CREATE TRIGGER "DEL_ANWESENHEIT" FOR "ANWESENHEIT" 
ACTIVE BEFORE DELETE POSITION 0
AS
      BEGIN
          DELETE FROM ANWESENEHIT WHERE MANR=OLD.MANR;
      END

Allerdings muss ich ja jetzt ein ersatzzeichen für ; definieren.
Weiss von euch jemand wie das geht, dachte immer mit
ausblenden Quelltext
1:
set term ^ ;					

aber das aktzeptiert er nicht
cherry
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 136

WinXP - Professional
RAD Studio 2009
BeitragVerfasst: Mi 20.07.05 14:41 
was passiert wenn du es einfach weglässt?
csigg Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 706

WIn XP, Win NT, Win2000, Suse8.0
Delphi 5, Delphi 6
BeitragVerfasst: Mi 20.07.05 14:43 
Dann kommt die Meldung, "unexpected end of Command" weil er das Semikolon als ende sieht
jaenicke
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 19336
Erhaltene Danke: 1751

W11 x64 (Chrome, Edge)
Delphi 12 Pro, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
BeitragVerfasst: Mi 20.07.05 14:46 
Und maskieren mit einem zweiten Semikolon?
csigg Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 706

WIn XP, Win NT, Win2000, Suse8.0
Delphi 5, Delphi 6
BeitragVerfasst: Mi 20.07.05 14:48 
Wie maskieren??
Ich hab das ganze eigentlich schonmal gemacht, weiss aber nichtmehr wie.
csigg Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 706

WIn XP, Win NT, Win2000, Suse8.0
Delphi 5, Delphi 6
BeitragVerfasst: Mi 20.07.05 14:50 
in der delphi-hilfe steht es so:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
set Term !! ;
CREATE TRIGGER "DEL_ANWESENHEIT" FOR "ANWESENHEIT"
ACTIVE BEFORE DELETE POSITION 0
AS
      BEGIN
          DELETE FROM ANWESENHEIT WHERE MANR=OLD.MANR;
      END
!!
Set Term ; !!

Da kommt bei mir aber immer "Invalid statement: ; set term"
csigg Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 706

WIn XP, Win NT, Win2000, Suse8.0
Delphi 5, Delphi 6
BeitragVerfasst: Mi 20.07.05 15:18 
Also das ist das Beispiel aus der Hilfe, ich kann da keinen unterschied erkennen:
ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
SET TERM !! ;
CREATE TRIGGER SAVE_SALARY_CHANGE FOR EMPLOYEE
  AFTER UPDATE AS
  BEGIN
    IF (OLD.SALARY <> NEW.SALARY) THEN
    INSERT INTO SALARY_HISTORY
    (EMP_NO, CHANGE_DATE, UPDATER_ID, OLD_SALARY, PERCENT_CHANGE)
      VALUES (OLD.EMP_NO, 'now', USER,OLD.SALARY,
      (NEW.SALARY - OLD.SALARY) * 100 / OLD.SALARY);
  END !!

SET TERM ; !!
jaenicke
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 19336
Erhaltene Danke: 1751

W11 x64 (Chrome, Edge)
Delphi 12 Pro, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
BeitragVerfasst: Mi 20.07.05 15:22 
DOCH!!! :autsch:
Wie wärs wenn du es mal groß schreibst? Das ist bei solchen Systemen anders als bei Delphi ein Unterschied!
csigg Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 706

WIn XP, Win NT, Win2000, Suse8.0
Delphi 5, Delphi 6
BeitragVerfasst: Mi 20.07.05 15:24 
hab ich auch schon ausprobiert, dies ist meine aktuelle source:
ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
SET TERM !! ;
CREATE TRIGGER DEL_ANWESENHEIT FOR ANWESENHEIT
ACTIVE BEFORE DELETE POSITION 0
AS
      BEGIN
          DELETE FROM ANWESENHEIT WHERE MANR=OLD.MANR;
      END !!
SET TERM ; !!
jaenicke
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 19336
Erhaltene Danke: 1751

W11 x64 (Chrome, Edge)
Delphi 12 Pro, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
BeitragVerfasst: Mi 20.07.05 15:31 
Also bei
ausblenden Quelltext
1:
SET TERM !! ;					

kommt bei mir keine Fehlermeldung.

Was passiert denn bei deinem letzten Code?
csigg Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 706

WIn XP, Win NT, Win2000, Suse8.0
Delphi 5, Delphi 6
BeitragVerfasst: Mi 20.07.05 15:37 
es kommt die Meldung:
Invalid Statement: ;
SET TERM
csigg Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 706

WIn XP, Win NT, Win2000, Suse8.0
Delphi 5, Delphi 6
BeitragVerfasst: Mi 20.07.05 15:43 
kann ich mir irgendwie das aktuelle ende Zeichen anzeigen lassen, kann es sein dass es bei mir vielleicht garnicht ; ist??
Lemmy
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 792
Erhaltene Danke: 49

Windows 7 / 10; CentOS 7; LinuxMint
Delphi 7-XE10.1, VS 2015
BeitragVerfasst: Do 21.07.05 07:01 
Guten Morgen,

meiner Meinung kommt die Fehlermeldung weil er schon nen anderen Terminator hat. Welche Konsole verwendest Du (IBExpert, IBConsole,...)??

Lemmy
csigg Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 706

WIn XP, Win NT, Win2000, Suse8.0
Delphi 5, Delphi 6
BeitragVerfasst: Do 21.07.05 07:35 
IBConsole, kannst du mir zufällig sagen wie ich das aktuelle anzeigen lassen kann??
csigg Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 706

WIn XP, Win NT, Win2000, Suse8.0
Delphi 5, Delphi 6
BeitragVerfasst: Do 21.07.05 07:54 
es hat mit obigen Quellcode geklappt.
ich hab heut morgen den Rechner hochgefahren, und mich neu an der DB angemeldet, dann hats geklappt.
jaenicke
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 19336
Erhaltene Danke: 1751

W11 x64 (Chrome, Edge)
Delphi 12 Pro, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
BeitragVerfasst: Do 21.07.05 11:01 
Na ja, wenn das SET TERM nicht rückgängig gemacht wurde, dann bleibt natürlich die Ersetzung bis zur erneuten Anmeldung erhalten...
Dann ist klar, was los war, vermutlich wurde der Code nicht bis zum zweiten SET TERM ausgeführt, und dadurch wurde die erste Änderung nicht rückgängig gemacht.
csigg Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 706

WIn XP, Win NT, Win2000, Suse8.0
Delphi 5, Delphi 6
BeitragVerfasst: Do 21.07.05 12:03 
jap, denk ich auch, dass bei meinen ersten Versuchen mittendriin abgebrochen wurd
Lemmy
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 792
Erhaltene Danke: 49

Windows 7 / 10; CentOS 7; LinuxMint
Delphi 7-XE10.1, VS 2015
BeitragVerfasst: Do 21.07.05 12:03 
Hi,

in der IBConsole kann man das unter Optionen einstellen. Leider weiß ich aber nicht genau wo Du diese im Menü findest, aber schau mal nach, ist ja nicht sehr groß...

Lemmy
csigg Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 706

WIn XP, Win NT, Win2000, Suse8.0
Delphi 5, Delphi 6
BeitragVerfasst: Do 21.07.05 12:04 
OK, dankeschön