|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Trigger and sql manager lite 2005
hi,
First, I apologize for the following english ... I am a very new user of firebird and I got some problems with the triggers. I have to create a script generating a database schema. The database is Firebird and the GUI SQL Manager Lite 2005. Everything is ok with the CREATE TABLE, INDEX...But my TRIGGERs doesn't work! This is my code : CREATE TRIGGER TABLE1_TRIGGER FOR TABLE1 ACTIVE BEFORE INSERT POSITION 0 AS BEGIN IF (NEW.ItemID IS NULL) THEN NEW.ItemID = GEN_ID (t1_generator,1); END; CREATE TRIGGER TABLE2_TRIGGER FOR TABLE2 ACTIVE BEFORE INSERT POSITION 0 AS BEGIN IF (NEW.SerID IS NULL) THEN NEW.SerID = GEN_ID (t2_generator,1); END; tx_generator are a generators. I generate this code with the trigger editor, when I commit this statesment, it works fine. But ... * When I copy this statesment to the file containing the whole database schema, open it in the SQL Editor, SQL Manager stops on my triggers. * I put the declarations of only 2 triggers in the SQL Editor, then I click on Execute Query : The first trigger is created, the second one fails. * I put only one statesment, I click on Explain Query : SQL Manager give me the following warning : Invalid token. Dynamic SQL Error. SQL error code = -104. Unexpected end of command. * In the same situation as the previous one, I click on Execute Query and the action success I tried to be as accurate as possible Best, Matthias |
![]() |
| Viewing: Dev Shed Forums > Databases > Firebird SQL Development > Trigger and sql manager lite 2005 |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|