Subject Re: Execute statement cant handle parameters which are NULL
Author emb_blaster
--- In firebird-support@yahoogroups.com, "ainpoissee" <ainpoissee@...> wrote:
>
> Hi,
>
> I'm using EXECUTE STATEMENT in trigger with two parameters like
>
> EXECUTE STATEMENT (:Statement) (NEW_Alates := NEW.Alates, NEW_Kuni := NEW.Kuni) INTO :Count;
>

The syntax to use it with INTO is:
EXECUTE STATEMENT <select-statement> INTO <var> [, <var> ...]

<select-statement> ::= An SQL statement returning at most one row of data.
<var> ::= A PSQL variable, optionally preceded by ":"

Theres no parameters to be used in EXECUTE STATEMENT. What you use in the :Statement variable? you can post your trigger and explain what you are trying to achieve?

> The problem is, that when either of the parameters is NULL then exception is raised:
>
> Message: isc_dsql_execute2 failed
> SQL Message : -901
> Unsuccessful execution caused by system error that does not preclude successful execution of subsequent statements
>
> Engine Code : 335544927
> Engine Message :
> Input parameters mismatch
> At trigger 'ALLYKSUS_IU_CHKNAME' line: 27, col: 1
>
> Is it a bug or this limitation is by design?
>
> TIA
> ain

Are you calling a Stored Procedure in the :Statment? this could explain the error mensage "parameters mismatch". Seems you are calling NEW.Alates and/or NEW.Kuni parameters? if it try please change it by COALESCE(NEW.ALATES,'NULL') and/or COALESCE(NEW.Kuni,'NULL').
WTH