Subject Re: [Fwd: "Illegal" subquery in if-clause]
Author Svein Erling Tysvær
--- In firebird-support@yahoogroups.com, Urs Liska wrote:
> Hello,
>
> I have a problem with a trigger.
>
> I wanted to do a check with a subquery in an if-clause:
>
> IF (NEW.ausgabe_id IN
> (SELECT ausgabe_id
> FROM sp_gedicht_ausgabenid(NEW.gedicht_id)))

Hi Urs!

Try

IF EXISTS(SELECT * FROM sp_gedicht_ausgabenid(NEW.gedicht_id) sga
WHERE sga.ausgabe_id = NEW.ausgabe_id)

Note: I haven't tried it and don't know whether it works or not.

HTH,
Set