Firebird SQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesFirebird SQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old August 22nd, 2006, 05:43 PM
matthiasBuchner matthiasBuchner is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2006
Posts: 1 matthiasBuchner User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 20 m 12 sec
Reputation Power: 0
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

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesFirebird SQL Development > Trigger and sql manager lite 2005


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway