On 17.May.2002 -- 11:12 AM, Torsten Curdt wrote:
> On Friday 17 May 2002 10:36, Christian Haul wrote:
> > On 17.May.2002 -- 10:01 AM, Torsten Curdt wrote:
> > > On Friday 17 May 2002 03:48, neil wrote:
> >
> > I believe that we actually should expect
> >
> > (resultset, update count)
> >
> >    | getMoreResults()
> >
> >    V
> > (resultset, update count)
> 
> well, but what will change the update count on the statement? how do you 
> iterate through it if you have no resultset at all but only update counts
> 
> update count
> update count
> update count
> 
> getMoreResults() should return no resultset at all... but how to iterate to 
> the next update count? again - it belongs to the statement...

I read the JDBC API that way that getMoreResults() closes the current
ResultSet and switches to the next result. A result consists among
others of a ResultSet and an UpdateCount. At least I get the
impression from the docs. So, if a complex statement i.e. a stored
procedure produces several results, why shouldn't it return several
update counts as well?

So with the scenario above, it would still work as each call to
getMoreResults() would switch to the next result. Incidently
containing no result set but an update count.

> > So the real question would be IMHO how should ESQL react with respect
> > to multiple ResultSets? Something like introducing an index attribute?
> 
> Well, current esql can already cope with multiple resultsets... question is 
> only update counts fit into this. since AFAICS they are tied to the 
> statement. see above
> 
> >    <esql:results index="1">
> >      ...
> >    </esql:results>
> >    <esql:update-results index="1">
> >      ...
> >    </esql:update-results>
> >    <esql:results index="2">
> >      ...
> >    </esql:results>
> >    <esql:update-results index="2">
> >      ...
> >    </esql:update-results>
> 
> well, that's not necessary since this can easily addressed with xpath.

Sure. Just thought it would be more intuitive for users to number
resultsets explicitly.

> > Afterall, each ResultSet may have a different structure and semantics.
> 
> sure... should already be taken care of

Is it? AFAIK we evalute the <esql:results/> block for each result. How
would I write different code for each result?

> > BTW can anyone remember what more-results are supposed to mean?
> 
> yes :-) 
> 
> it's for the limit clause... we use esql for paging though a resultset (like 
> google)

Oh yes! That's what I thought. But thinking about multiple result sets
made me wonder if it was supposed be stem from this area. Thanks for
the explanation, anyway.

        Chris.

-- 
C h r i s t i a n       H a u l
[EMAIL PROTECTED]
    fingerprint: 99B0 1D9D 7919 644A 4837  7D73 FEF9 6856 335A 9E08

---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <[EMAIL PROTECTED]>
For additional commands, e-mail: <[EMAIL PROTECTED]>

Reply via email to