Subject Re: [firebird-support] How to use a Domain in a Stored Procedure
Author Jacqui Caren
Daniel Rail wrote:
> The other question where everybody didn't seem to agree on, was: do
> you take into consideration the constraints found in the domain, or
> simply the datatype?

In Oracle %type does not inherit anything other than the type.

IMHO if a domain is used then the domain should be used (as much
as possible) however if domainname%TYPE or table.field%TYPE is used
then only the data type is inherited.

> Also, for these changes to take place immediately, there can only be
> one user connected, otherwise those changes will have to be deferred
> to the first occasion that they can be done(possibly only when there
> is no connections, or all objects involved are no longer in use), or
> simply get the error "object in use" and force the user to try again
> later.

Under Oracle, %type used to be a compile time directive. This means
that if you modified a table you would recompile your SP/PKG/triggers.
I like the idea of having this done dynamically but the ability to do
this at compile time is the first "big win" when developing schemas.

Currently I use a script that does domain to datatype mapping for me.

Perhaps I should start using %type instead of my rather tacky comments?

Hmm a kludge to handle %type translation in my sp/trigger loader?


> This is just my 2 cents.

Well written!