Subject RE: [firebird-support] Re: Triggers
Author Nigel Weeks
That'll be because you've got a space between AREA_ and NEXTNO.



Generator names can't have spaces.







Nigel Weeks

Tech Support and Systems Developer

Rural Press Tasmania

The Examiner Newspaper

Ph. 03 6336 7234

Mob. 0408 133 738

Email. <mailto:nweeks@...> nweeks@...

_____

From: firebird-support@yahoogroups.com
[mailto:firebird-support@yahoogroups.com] On Behalf Of Sivarasa Visakan
Sent: Thursday, 19 April 2007 10:26 AM
To: firebird-support@yahoogroups.com
Subject: Re: [firebird-support] Re: Triggers



Nando,

I did what you mensioned but I get the following;

Starting transaction...
Preparing query:
CREATE TRIGGER Tri_Area FOR AREA
ACTIVE BEFORE INSERT
AS
BEGIN
new.SEQ = GEN_ID(AREA_ NEXTNO,1) ;
END
*** IBPP::SQLException ***
Context: Statement::Prepare(
CREATE TRIGGER Tri_Area FOR AREA
ACTIVE BEFORE INSERT
AS
BEGIN
new.SEQ = GEN_ID(AREA_ NEXTNO,1) ;
END )
Message: isc_dsql_prepare failed

SQL Message : -104
Invalid token

Engine Code : 335544569
Engine Message :
Dynamic SQL Error
SQL error code = -104
Token unknown - line 6, column 24
NEXTNO

Execute time: 00:00:00.

Regards
Visakan

Nando Dessena <nando@dessena. <mailto:nando%40dessena.it> it> wrote:
Visakan,
copy this *as it is* into FlameRobin's query editor:

SET TERM ^;
CREATE TRIGGER Tri_Area FOR AREA
ACTIVE BEFORE INSERT
AS
BEGIN
new.SEQ = GEN_ID(AREA_NEXTNO,1);
END^
SET TERM ;^

Don't select any part of it and press F4. That should work.

BTW, you might be interested in knowing that FlameRobin has an
auto-increment feature that will create triggers similar to the above
automatically.

Ciao
--
Nando Dessena
======================================================
I support Firebird, I am a Firebird Foundation member!
Join today at http://www.firebird <http://www.firebirdsql.org/ff/foundation>
sql.org/ff/foundation
======================================================





---------------------------------
Yahoo! Mail is the world's favourite email. Don't settle for less, sign up
for your freeaccount today.

[Non-text portions of this message have been removed]



__________ NOD32 2202 (20070418) Information __________

This message was checked by NOD32 antivirus system.
http://www.eset.com



[Non-text portions of this message have been removed]