Subject | Re: [firebird-support] How do you write a procedure which returns a DataSet containing multiple tables |
---|---|
Author | unordained |
Post date | 2010-03-23T19:19:11Z |
---------- Original Message -----------
From: "Dixon" <dixonepperson@...>
Subject: [firebird-support] How do you write a procedure which returns a DataSet
containing multiple tables
I know that Microsoft SQL Server has the ability to return multiple datasets in a
single procedure, and iterating over datasets is part of the JDBC spec because of
it. But I don't think anyone else supports it, and Firebird certainly doesn't.
A stored procedure either has output variables (suspend isn't called), or it
returns a single table (suspend gets called zero or more times).
Either break up your procedure, or live with the fact that it's going to return
the equivalent of "people left join addresses", or come up with a single-table
output that you like (a "type of row" field, plus other fields; the first row
would return "people" information, subsequent rows would return "address"
information.)
Is there a specific reason you need this to come from one procedure? Are you
converting code as-is from SQL Server? Is it an efficiency issue, where a joined
resultset is larger than you'd like, because of duplicated information across
rows (person info)?
-Philip
From: "Dixon" <dixonepperson@...>
Subject: [firebird-support] How do you write a procedure which returns a DataSet
containing multiple tables
> How do you write a procedure which returns a DataSet containing------- End of Original Message -------
> multiple tables
I know that Microsoft SQL Server has the ability to return multiple datasets in a
single procedure, and iterating over datasets is part of the JDBC spec because of
it. But I don't think anyone else supports it, and Firebird certainly doesn't.
A stored procedure either has output variables (suspend isn't called), or it
returns a single table (suspend gets called zero or more times).
Either break up your procedure, or live with the fact that it's going to return
the equivalent of "people left join addresses", or come up with a single-table
output that you like (a "type of row" field, plus other fields; the first row
would return "people" information, subsequent rows would return "address"
information.)
Is there a specific reason you need this to come from one procedure? Are you
converting code as-is from SQL Server? Is it an efficiency issue, where a joined
resultset is larger than you'd like, because of duplicated information across
rows (person info)?
-Philip