Subject Re: Unsupported Column Type: 0
Author sllimr7139
Hi Helen,

<snip>

> Well, you do have some ambiguities between the main query and the
subquery,
> but I suspect the cause of the error you are seeing is that you are
using
> IB_SQL's DSQL interface to submit this request and you have
forgotten to
> uncheck the Params checkbox.
>

Could you point out the ambiguities? I'm currently using Marathon
v3.0.0.50 RC1 (Using IBObjects v4.5x) as such I'm not using IB_SQL.
If it's something I've got wrong in my trigger code I can fix that
straight away. But if it's not I need to track it down and fix it in
the Marathon code. So knowing what I've done wrong in the trigger
code would be a very good place for me to start.

Ryan.

>The original trigger code is this:
>...
>as
>declare variable memid integer;
>begin
> for
> select memberid
> from organizationmember
> where organizationid = new.organizationid and
> memberwantsemails = 1 and
> memberstatus >= 1 and
> memberid not in (select memberid
> from emailjobstats
> where emailjobid = new.emailjobid)
> into :memid
> do
> begin
> insert into emailjobstats (emailjobid, memberid)
> values (new.emailjobid, :memid);
> end
>end
>
>
>The new code I'm trying to compile is this:
>.....
>as
>declare variable memid integer;
>DECLARE VARIABLE wisjot smallint;
>DECLARE VARIABLE wwantsjot smallint;
>BEGIN
> SELECT isjot
> FROM emailjobs
> WHERE emailjobid = new.emailjobid
> INTO :wisjot;
>
> for
> select memberid,
> memberwantsjot
> from organizationmember
> where organizationid = new.organizationid and
> memberwantsemails = 1 and
> memberstatus >= 1 and
> memberid not in (select memberid
> from emailjobstats
> where emailjobid = new.emailjobid)
> into :memid, :wwantsjot
> do
> BEGIN
> IF (((wisjot=1) and (wwantsjot=1)) or (wisjot=0)) then
> begin
> INSERT into emailjobstats (emailjobid, memberid)
> values (new.emailjobid, :memid);
> end
> end
>END