Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 4 of 4 total
Thread Trigger problem
Fri, Jul 20 2007 9:25 AMPermanent Link

Durumdara
I want to create my second trigger in EDB.

CREATE TRIGGER "ALMAFA" AFTER INSERT
ON "test"
BEGIN
DECLARE v INTEGER;
SET v = kod;
SET NEWROW.KOD = v;
end;

================================================================================
SQL Error (ElevateDB 1.04 Build 6)
================================================================================

ElevateDB Error #700 An error was found in the statement at line 6 and column 5
(Invalid expression "NEWROW"."KOD" found, a value cannot be assigned to this
column reference)

CREATE TRIGGER "ALMAFA" AFTER INSERT
ON "test"
BEGIN
SET KOD = 1;
end;

================================================================================
SQL Error (ElevateDB 1.04 Build 6)
================================================================================

ElevateDB Error #700 An error was found in the statement at line 4 and column 5
(Expected column name, parameter name, variableorname but instead found "KOD")

How to I change the column (KOD) value to 1?

In FireBird I can do this.

THanks for your help:
dd

Ps1:
In the EDBManager I don't see "Edit Trigger" menupoint. How to I edit them?

Ps2:
Are triggers working in flat-table mode too?

Fri, Jul 20 2007 3:52 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Durumdara,

<< ElevateDB Error #700 An error was found in the statement at line 6 and
column 5 (Invalid expression "NEWROW"."KOD" found, a value cannot be
assigned to this column reference) >>

You cannot assign values to any columns in an AFTER INSERT trigger.  This
has to be done in a BEFORE INSERT trigger.

<< In FireBird I can do this. >>

It allows you to modify columns in a row in an AFTER trigger ?  I don't
think that is standard.

<< In the EDBManager I don't see "Edit Trigger" menupoint. How to I edit
them? >>

Currently you have to drop it and then re-add it.  You can get the trigger
definition by using the following query on the current database:

SELECT * FROM Information.Triggers WHERE Name='MyTriggerName'

<< Are triggers working in flat-table mode too? >>

If you mean a local session (as opposed to a remote session), then yes, they
work in local sessions.

--
Tim Young
Elevate Software
www.elevatesoft.com

Mon, Jul 23 2007 6:25 AMPermanent Link

Durumdara
"Tim Young [Elevate Software]" <timyoung@elevatesoft.com> wrote:


<< In the EDBManager I don't see "Edit Trigger" menupoint. How to I edit
them? >>

Currently you have to drop it and then re-add it.  You can get the trigger
definition by using the following query on the current database:
SELECT * FROM Information.Triggers WHERE Name='MyTriggerName'
>>>

This is not too user friendly solution.
It is possible to upgrade the manager to
1.) I can see the source of the trigger (as in IBConsole, or IBExpert).
2.) I can change it. In the bkg. the manager drops the trigger and create a new.


Thanks for the infos.

dd
Mon, Jul 23 2007 2:51 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Durumdara,

<< It is possible to upgrade the manager to >>

This is already on the list of items to be addressed in the next 1.05
release.

--
Tim Young
Elevate Software
www.elevatesoft.com

Image