Subject | RE: [ib-support] Creating a Trigger gives Error Msg: Invalid Column type: 0 |
---|---|
Author | Alan McDonald |
Post date | 2002-11-15T10:18:24Z |
You've declared exception
EX_Sire_Invalid_Sex?
-----Original Message-----
From: Raymond Kennington [mailto:progsol@...]
Sent: Friday, 15 November 2002 21:07
To: ib-support@yahoogroups.com
Subject: Re: [ib-support] Creating a Trigger gives Error Msg: Invalid
Column type: 0
Alan McDonald wrote:
successfully and I
have dozens of other triggers to add.
Raymond Kennington
Programming Solutions
W2W Team B
To unsubscribe from this group, send an email to:
ib-support-unsubscribe@egroups.com
Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
[Non-text portions of this message have been removed]
EX_Sire_Invalid_Sex?
-----Original Message-----
From: Raymond Kennington [mailto:progsol@...]
Sent: Friday, 15 November 2002 21:07
To: ib-support@yahoogroups.com
Subject: Re: [ib-support] Creating a Trigger gives Error Msg: Invalid
Column type: 0
Alan McDonald wrote:
>The 2nd trigger.
> Raymond,
> which trigger gives the error,
> and can I ask why you set the position of the pk trigger so high?The generator trigger should only occur after all triggers have fired
successfully and I
have dozens of other triggers to add.
> Creating a Trigger gives Error Msg: Invalid Column type: 0:ParentID,
>
> Here's the relevant info:
>
> CREATE TABLE Animal
> (
> ID INTEGER NOT NULL,
> Name VARCHAR(20) NOT NULL,
> Sex Char(1) NOT NULL,
> "Sire ID" INTEGER,
> "Dam ID" INTEGER
> )
>
> ALTER TABLE Animal ADD CONSTRAINT PK_Animal PRIMARY KEY (ID)
>
> CREATE TRIGGER BI_GEN_ANIMAL_ID FOR ANIMAL
> ACTIVE
> BEFORE INSERT
> POSITION 32767
> AS
> begin
> if (new.ID is NULL) then
> new.ID = gen_id(GEN_ANIMAL_ID, 1);
> end
>
> CREATE EXCEPTION EX_Sire_DNE 'Sire DNE';
> CREATE EXCEPTION EX_Dam_DNE 'Dam DNE';
>
> CREATE TRIGGER BI_CHECK_ANIMAL_SIRE FOR ANIMAL
> ACTIVE
> BEFORE INSERT
> POSITION 1
> AS
> DECLARE VARIABLE ParentID INTEGER;
> DECLARE VARIABLE ParentSex CHAR(1);
> begin
> if (NEW."Sire ID" IS NOT NULL) then
> begin
> SELECT ID, Sex FROM Animal WHERE (ID = NEW."Sire ID") INTO
> :ParentSex;--
>
> if (:ParentID IS NULL) then
> begin
> EXCEPTION EX_Sire_DNE;
> end
>
> if (:ParentSex <> 'M') then
> begin
> EXCEPTION EX_Sire_Invalid_Sex;
> end
> end
> end
>
> What's the problem?
>
> TIA.
> Raymond.
Raymond Kennington
Programming Solutions
W2W Team B
To unsubscribe from this group, send an email to:
ib-support-unsubscribe@egroups.com
Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
[Non-text portions of this message have been removed]