Subject Re: Fb 2.1 and Domains in Procedure Parameters
Author emb_blaster
--- In firebird-support@yahoogroups.com, "Martijn Tonies"
<m.tonies@...> wrote:
>
> Hey,
>
> I'm trying to use Domains in Procedure Parameters like this:
>
> ALTER PROCEDURE DOMAIN_TEST (
> D D_BETWEEN4AND10 default 4,
> D2 SmallInt,
> DE D_EMAIL DEFAULT 'test')
> returns (
> MON D_MONEY,
> MON2 Numeric(18,4)) AS
> begin
> exit;
> end
>
> But I get a message:
> Dynamic SQL Error SQL error code = -204 can not define a not null column
> with NULL as default value invalid clause --- 'defaults must be last'
>

If you give a parameter a default value, all parameters coming after
it must also get default values. in this case D2 must have a default
value or become before others parms.


> If I remove "default 4", it works fine. The domain has no default
defined.
>
> If I try this:
>
> MON2 Numeric(18,4) default 2) AS
>
> Then I get:
> Dynamic SQL Error SQL error code = -104 Token unknown - line 7, char 22
> default

I think that output params cannot have a default param this way. you
can do instead,

MON2 Numeric(18,4)) AS
begin
MON2 = 2;