Subject Re: [Firebird-Architect] Domains in PSQL - constraints
Author Martijn Tonies
Hi,

> When we discussed domains usage in PSQL we go to implement only data
> type support (TYPE OF) without default value and constraints.
>
> The trick problem was with constraints and output parameters.
>
> I see very unintuitive to need to declare default value for output
> parameters in case the domain is not-nullable and don't have a default,
> in more or less this way:
> create procedure sp returns (o dom = 1)
> as
> begin
> end
>
> So I propose we defer variables/parameters constraints to first read,
> but of course checking in assignments too.

Sounds very logical.

> So you'll get an error if you read a not-nullable variable/parameter
> that is null or try to assign null to it, but don't get error if you
> declare and not use it.

Sounds fair to me.

> For output parameters, you get error if you try to exit/suspend the
> procedure with nulls on output parameters.
>
> Comments?

Question: this is for the true usage of domains in PSQL then?

If so: good job!

Martijn Tonies
Database Workbench - tool for InterBase, Firebird, MySQL, NexusDB, Oracle &
MS SQL Server
Upscene Productions
http://www.upscene.com
My thoughts:
http://blog.upscene.com/martijn/
Database development questions? Check the forum!
http://www.databasedevelopmentforum.com