Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 6 of 6 total
Thread CREATE TRIGGER.
Sat, Jun 14 2008 2:00 AMPermanent Link

Abdulaziz Jasser
I am trying to create a trigger use the following script but I got error when trying to execute it (line 4 column 16):


CREATE TRIGGER "AccountUpdate" AFTER UPDATE OF "AccountNo"
ON "TB_AccountsChart"
BEGIN
  INSERT INTO TB_Log (Form_Name) VALUES (NEWROW.AccountNo);
END
Sat, Jun 14 2008 3:06 AMPermanent Link

ulibecker
Abdulaziz,

<<
CREATE TRIGGER "AccountUpdate" AFTER UPDATE OF "AccountNo"
ON "TB_AccountsChart"
BEGIN
  INSERT INTO TB_Log (Form_Name) VALUES (NEWROW.AccountNo);
END
>>

try Execute Immediate 'INSERT INTO TB_Log (Form_Name) VALUES (' + Cast(NEWROW.AccountNo as
VarChar) + ')';

Untested.

Uli
Sat, Jun 14 2008 3:06 PMPermanent Link

Abdulaziz Jasser
Uli

<<try Execute Immediate 'INSERT INTO TB_Log (Form_Name) VALUES (' + Cast(NEWROW.AccountNo as
VarChar) + ')';

Untested.>>

Sorry, but does not work.  I still get an error.
Sat, Jun 14 2008 3:10 PMPermanent Link

Fernando Dias

Team Elevate Team Elevate

Abdulaziz,

It's very difficult to help you if you don't tell us at least what error
do you get and what EDB version are you using...

--
Fernando Dias
[Team Elevate]
Sun, Jun 15 2008 12:27 AMPermanent Link

"Raul"
Try following as body of the trigger :

BEGIN
 DECLARE st STATEMENT;
 PREPARE st FROM 'insert into TB_LOG (FORM_NAME) VALUES (?)';
 EXECUTE st USING NEWROW.AccountNo;
END

Raul

"Abdulaziz Jasser" <jasser@cyberia.net.sa> wrote in message
news:19440235-373A-4FF7-85B8-A474521F918D@news.elevatesoft.com...
>I am trying to create a trigger use the following script but I got error
>when trying to execute it (line 4 column 16):
>
>
> CREATE TRIGGER "AccountUpdate" AFTER UPDATE OF "AccountNo"
> ON "TB_AccountsChart"
> BEGIN
>   INSERT INTO TB_Log (Form_Name) VALUES (NEWROW.AccountNo);
> END
>

Sun, Jun 15 2008 4:24 PMPermanent Link

Abdulaziz Jasser
Raul,


<<Try following as body of the trigger :

BEGIN
 DECLARE st STATEMENT;
 PREPARE st FROM 'insert into TB_LOG (FORM_NAME) VALUES (?)';
 EXECUTE st USING NEWROW.AccountNo;
END>>

Thanks now it works.
Image