Subject Re: [ib-support] Creating trigger - SQL error
Author Entrebytes S.L.
Hi Walter. The problem is the assign the NULL word. To assign you should use
"IS NULL".
You should change the equal (=) from IS.

The finally trigger is:

AS
> BEGIN
> if (new.Pkey IS NULL) then
> new.Pkey = gen_id(BENUTZER_GEN,1);
> END
>




Emili Pla
EntreBytes S.L.
Ontinyent , Spain
ERP Development.
----- Original Message -----
From: "Walter Neumann" <walter@...>
To: <ib-support@yahoogroups.com>
Sent: Friday, September 06, 2002 4:51 PM
Subject: [ib-support] Creating trigger - SQL error


> Hi,
> I am using Firebird 1.0, dialect 3, IBAccess. I was creating a trigger
(form
> Devweloppers Guide, p. 34) by IBAccess:
>
> IBAccess - Table - Triggers - New Trigger
> Name: BENUTZER_INSERT
> Type: BeforeInsert
> Position: 0
>
> AS
> BEGIN
> if (new.Pkey = NULL) then
> new.Pkey = gen_id(BENUTZER_GEN,1);
> END
>
> Error-Code:
> Dynamic SQL Error
> SQL error code=-104
> Token unknown - line 3, char 18
> NULL.
>
> Why doesn't SQL know NULL?
> Can anyone explain me whot's wrong?
> Tank you.
> Walter Neumann
>
>
> To unsubscribe from this group, send an email to:
> ib-support-unsubscribe@egroups.com
>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>