Subject Re: [firebird-support] Re: domains inside Stored Procedures
Author Ann W. Harrison
Adam,
>
>
> The same way you handle someone trying to put an integer into a
> varchar field or a string into a timestamp. If I define
>
> CREATE DOMAIN TBLID AS INTEGER check( value > 0 ) NOT NULL;
>
> And someone tries to use a parameter of -1, then it is an invalid
> typecast (or whatever the error is). It is as wrong (from a business
> rules perspective) as trying to insert 'Adam' into such a field.
> Obviously, just my personal opinion

OK, I'm with you on input. But should the output parameters also be
constrained (hint, the answer is yes)? OK, but what about intermediate
results... If the output parameter is not null, can you set it to null
within the procedure, or does that cause an error?
>
> And what happens to a procedure when the constraint on the
> domain of one of its parameters changes?
>
> I imagine it would have to recompile.

That sounds good, except that procedures can't be recompiled while
they're running, so the exact mechanism is tricky. Not that it can't be
resolved, but that it's non-trivial.
>
>
> Thats fine. The work around is pretty simple. ... but I still think
> that in the long run this will be a very powerful feature.
>

I agree completely

Regards,


Ann