Re: [GENERAL] Functions returning multiple rowsets

2009-09-29 Thread Thom Brown
2009/9/28 Merlin Moncure > > > with s as (select * from two_sets()), > foo as (select unnest(_foos) from s), > bar as (select unnest(_bars) from s) > select > (select count(*) from foo) as no_foos, > (select count(*) from bar) as no_bars; > > merlin > I can see this working as we will be using

Re: [GENERAL] Functions returning multiple rowsets

2009-09-28 Thread Owen Hartnett
On Sep 28, 2009, at 3:31 PM, Mike Christensen wrote: One thing I like about Microsoft SQL is you can write a sproc that does: SELECT * FROM TableA SELECT * FROM TableB And in .NET, you'll have a DataSet object with two DataTables, one for each table. Do either of the techniques outlined be

Re: [GENERAL] Functions returning multiple rowsets

2009-09-28 Thread Pavel Stehule
2009/9/28 Mike Christensen : > One thing I like about Microsoft SQL is you can write a sproc that does: > > SELECT * FROM TableA > SELECT * FROM TableB > > And in .NET, you'll have a DataSet object with two DataTables, one for > each table.  Do either of the techniques outlined below provided this

Re: [GENERAL] Functions returning multiple rowsets

2009-09-28 Thread Mike Christensen
One thing I like about Microsoft SQL is you can write a sproc that does: SELECT * FROM TableA SELECT * FROM TableB And in .NET, you'll have a DataSet object with two DataTables, one for each table. Do either of the techniques outlined below provided this functionality, though I suppose in .NET y

Re: [GENERAL] Functions returning multiple rowsets

2009-09-28 Thread Merlin Moncure
On Mon, Sep 28, 2009 at 2:05 PM, Merlin Moncure wrote: > On Mon, Sep 28, 2009 at 12:49 PM, Thom Brown wrote: >> Hi, >> >> Is it possible to create a function using 'SQL' as language which could >> return multiple rowsets, such as "SELECT * FROM TABLE1; SELECT * FROM >> TABLE2;" where both results

Re: [GENERAL] Functions returning multiple rowsets

2009-09-28 Thread Merlin Moncure
On Mon, Sep 28, 2009 at 12:49 PM, Thom Brown wrote: > Hi, > > Is it possible to create a function using 'SQL' as language which could > return multiple rowsets, such as "SELECT * FROM TABLE1; SELECT * FROM > TABLE2;" where both results are returned in the output?  I know this can be > done in stor

Re: [GENERAL] Functions returning multiple rowsets

2009-09-28 Thread Pavel Stehule
Hello 2009/9/28 Thom Brown : > Hi, > > Is it possible to create a function using 'SQL' as language which could > return multiple rowsets, such as "SELECT * FROM TABLE1; SELECT * FROM > TABLE2;" where both results are returned in the output?  I know this can be > done in stored procedures in other

[GENERAL] Functions returning multiple rowsets

2009-09-28 Thread Thom Brown
Hi, Is it possible to create a function using 'SQL' as language which could return multiple rowsets, such as "SELECT * FROM TABLE1; SELECT * FROM TABLE2;" where both results are returned in the output? I know this can be done in stored procedures in other RBDMS but can this be done in a function?