> > for my task I need little different form :-(
> >
> > create function a(..) returns setof tables
> >
> > but SQL2003 needs type table, and this can be solution
>
>You want a function return entire tables at a time? Why bother when you
>can just return rows and signal when the next table starts?
>
what is difference between rows with different structures and tables? Tables
are more logic. But I unlike function which returns setof tables. This need
data type table. I prefere normal clasic solution.
-------------- stored proc -------------- | --------------- client
------------------
function -> scalar, vector, table
procedure -> OUT params
-----------------------------
every free select --------------------------------> table
-----------------------------
I don't have imagine how I can write readable code with your proposal
variants one:
create function aaa returns setof anyrecord
begin for each a in select * from temptab1 return next a; end loop; return next 'next table'; for each a in select *
fromtemptab2 return next a; end loop; return next 'ok'; return;
end;
variants two:
create procedure aaa(OUT allok bool)
begin select * from temptab1; select * from temptab2; a := true;
end;
I don't have better words :-). I am sorry. I don't wont to complicate
internal structure of planer, executor, etc ... Procedures are different
than functions, and can be executed different, Isn't possible using
procedure in params list.
Nice day
Pavel
_________________________________________________________________
Citite se osamele? Poznejte nekoho vyjmecneho diky Match.com.
http://www.msn.cz/