Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 3 of 3 total
Thread Question for Trigger
Thu, Nov 6 2008 4:10 PMPermanent Link

"KHJ"
BEGIN
DELETE FROM ngruppe
WHERE ngruppe_id not in (select name_ngruppe_id from name)
AND ngruppe_id not in (select wgruppe_ngruppe_id from wgruppe)
AND ngruppe_id <> 29
END

In DBISAM this worked fine within a query.
Now I tried to use it in a trigger for the table name to modify the
table ngruppe if i delete one item in table name.

Message:
ElevateDB Error #700 An error was found in the statement at line 5 and
column 1 (Expected ; but instead found WHERE)

Regards Karlheinz
Thu, Nov 6 2008 10:27 PMPermanent Link

"Raul"
Try this instead in trigger :

BEGIN
 EXECUTE IMMEDIATE 'DELETE FROM ngruppe WHERE ngruppe_id not in (select
name_ngruppe_id from name) AND ngruppe_id not in (select wgruppe_ngruppe_id
from wgruppe) AND ngruppe_id <> 29';
END



"KHJ" <KarlheinzREMOVEJansen@RemoveWeb.de> wrote in message
news:E451553B-8CA5-47A7-B72C-1DB156A7F97A@news.elevatesoft.com...
> BEGIN
> DELETE FROM ngruppe
> WHERE ngruppe_id not in (select name_ngruppe_id from name)
> AND ngruppe_id not in (select wgruppe_ngruppe_id from wgruppe)
> AND ngruppe_id <> 29
> END
>
> In DBISAM this worked fine within a query.
> Now I tried to use it in a trigger for the table name to modify the
> table ngruppe if i delete one item in table name.
>
> Message:
> ElevateDB Error #700 An error was found in the statement at line 5 and
> column 1 (Expected ; but instead found WHERE)
>
> Regards Karlheinz
Fri, Nov 7 2008 11:55 AMPermanent Link

"KHJ"
Raul wrote:

> Try this instead in trigger :
>
> BEGIN
> EXECUTE IMMEDIATE 'DELETE FROM ngruppe WHERE ngruppe_id not in
> (select name_ngruppe_id from name) AND ngruppe_id not in (select
> wgruppe_ngruppe_id from wgruppe) AND ngruppe_id <> 29'; END
>

Thanks Raul,

works fine now.

Karlheinz
Image