Subject | Re: [Firebird-Architect] transient data sets and procedures |
---|---|
Author | Ann W. Harrison |
Post date | 2005-02-19T20:49:19Z |
Nando Dessena wrote:
transient data set to the procedure rather than just allowing a
reference - like a reference to a table? You don't pass tables to
procedures... Possibly that would allow a program to create a transient
data set with one name and pass it to a procedure that calls it
something else. Is that important if the structure of the two has to be
identical.
defined on the fly - and completely in the range of the Global Temporary
Tables that Vlad proposed, where the metadata is permanent and stable.
Useful things, but useful in a different context. Maybe the right
answer answer is that procedures and transient data sets don't mix and
if you want to use private data with procedures, use global temporary
tables.
it in a flat names space doesn't seem all that clear. I can certainly
understand a procedure creating a transient data set and having it go
away when the procedure exits. However, that idea leads to massive
monolithic procedures, which are, IMHO, a bad thing.
Regards,
Ann
>Err, I've missed something... What do you gain by passing the
> would it be that much of an overhaul to allow passing TDSs as
> procedure parameters and map the local declaration to an inbound
> parameter name? Example:
>
> create procedure fattest_cats (counter integer,
> fatter_cats transient data set)
> returns (name varchar (30), age integer, salary integer)
> as
> describe fatter_cats
> (name varchar (30), age integer, salary integer);
> begin
> ...
> end
transient data set to the procedure rather than just allowing a
reference - like a reference to a table? You don't pass tables to
procedures... Possibly that would allow a program to create a transient
data set with one name and pass it to a procedure that calls it
something else. Is that important if the structure of the two has to be
identical.
> I can see it's ugly, but I fear that a more elegant solution wouldAnd that gets wholly away from the point of transient data sets -
> involve stricter typing through domains and require the use of domains
> as procedure parameters:
>
> create domain d_fattest_cats
> as table (name varchar (30), age integer, salary integer);
defined on the fly - and completely in the range of the Global Temporary
Tables that Vlad proposed, where the metadata is permanent and stable.
Useful things, but useful in a different context. Maybe the right
answer answer is that procedures and transient data sets don't mix and
if you want to use private data with procedures, use global temporary
tables.
> A> Is it important to be able to destroy a transient data set?I'm not sure... Scoping makes lots of sense in hierarchies - applying
>
> if it's global, yes. If not, scoping rules would do.
>
it in a flat names space doesn't seem all that clear. I can certainly
understand a procedure creating a transient data set and having it go
away when the procedure exits. However, that idea leads to massive
monolithic procedures, which are, IMHO, a bad thing.
Regards,
Ann