Board index » delphi » error on altering trigger

error on altering trigger


2006-10-23 04:11:13 AM
delphi188
Hello all,
I have Interbase 7.5 server.
IBConsole 7.5.0.5
In interbase I go to triggers ->select the one I want ->and click Alter.
then even without making any changes, when I click "OK" to alter the trigger
I get following error:
-----------------------------------
Metadata update error
Detail Message:
-----------------------------------
 
 

Re:error on altering trigger

Sorry I posted last message accidently.
let me put the error msg here:
-----------------------------------
Metadata update error
Detail Message:
Dynamic SQL Error
SQL error code = -104
Token unknown - line 2, char -1
AS
-----------------------------------
and this is the code that the trigger actually has:
SET TERM ^ ;
/* Triggers only will work for SQL triggers */
CREATE TRIGGER "ABONO_BEFORE_INS" FOR "ABONO"
ACTIVE BEFORE INSERT POSITION 0
AS begin
new.ABONO_FULL_NUM=new.ABONO_YEAR || new.ABONO_MONTH || new.ABONO_NUM;
end
^
COMMIT WORK ^
SET TERM ;^
Does anyone know what could the problem be??? could it be a bug with
IBConsole ???
Thanks a lot in advance.
George
 

Re:error on altering trigger

George Goglidze writes:
Quote
Sorry I posted last message accidently.
let me put the error msg here:

-----------------------------------
Metadata update error

Detail Message:

Dynamic SQL Error
SQL error code = -104
Token unknown - line 2, char -1
AS
-----------------------------------
and this is the code that the trigger actually has:

SET TERM ^ ;


/* Triggers only will work for SQL triggers */

CREATE TRIGGER "ABONO_BEFORE_INS" FOR "ABONO"
ACTIVE BEFORE INSERT POSITION 0
AS begin
new.ABONO_FULL_NUM=new.ABONO_YEAR || new.ABONO_MONTH ||
new.ABONO_NUM; end
^

COMMIT WORK ^
SET TERM ;^


Does anyone know what could the problem be??? could it be a bug with
IBConsole ???

Thanks a lot in advance.

George
Are you using the SQL-window or the Trigger editor?
--
 

Re:error on altering trigger

George Goglidze writes:
Quote
Does anyone know what could the problem be??? could it be a bug with
IBConsole ???
You can find out easily by running the code in isql. If it works there
then the problem is not your code.
--
Bill Todd (TeamB)
 

Re:error on altering trigger

Hi Bill,
Thanks for your answer,
I did try this code, and it runs fine in ISQL (Interactive SQL).
it does compile, although if I run this code I have to delete the trigger
first,
and then run the code to create a new one.
But it is not just one trigger, almost all the triggers behave the same.
as well if I create the trigger with the code mentioned in first post in
ISL, it creates itself but
then when I try to modify it in trigger editor it gives me the same error.
But when I delete the trigger and then re-create it using trigger editor and
not the ISQL.
then later on it doesn't give me that error when I alter it.
Thanks to all,
Regards.
 

Re:error on altering trigger

I found the problem.
thanks to everyone for helping me! :)
the triggers were created in different application not in IBConsole.
so it didn't have the same syntax as IBConsole would auto generate.
although it worked fine because it was valid sql syntax.
so db worked, only when I wanted to alter it in trigger editor, it wouldn't
behave correctly
as it didn't understand all the metadata.
thanks a lot.