Hey Torsten,

> > The other patch will allow looping to be controlled completely from
> > the outside of esql.  This just entails exposing "next-row" and is
> > "more rows?" functionality through the logic sheet.  Also, the
> > <esql:get-???> calls will have to be made available to descendents of
> > <esql:results> not just <row-results>
> 
> ...why would someone want to have ResultSet values *NOT* under
> row-results. That's exactly how JDBC does it and I couldn't think of any
> reason not to do it the same way...

Nobody would want to do that.  But they might want to control the 
looping structure that is row results rather than using <esql:row-results/>.

Entertaining example attached...  don't mind the _esql_query.keepgoing() it would be 
replaced with <esql:keep-going/>

So why not just use subqueries?   1 query vs. 30 query.

Stop me if it's FS.

Tim
<?xml version="1.0"?>

<xsp:page 
language="java"
xmlns:xsp="http://apache.org/xsp";
xmlns:cal="http://apache.org/xsp/cal/1.0";
xmlns:xsp-request="http://apache.org/xsp/request/2.0";
xmlns:esql="http://apache.org/cocoon/SQL/v2";>
<xsp:structure>
  <xsp:include>java.util.Vector</xsp:include>
</xsp:structure>

<page>
  <style>
    td { vertical-align: top; border : thin green solid; width:1in; height: 1in}
    table { border : thin green solid}
  </style>

<esql:connection>
  <esql:pool>cal</esql:pool>
  <esql:execute-query>
    <esql:query>select id, title, description, event_date from event order by 
event_date asc</esql:query>
    <esql:results>

  <cal:monthly year="2002" month="2">
    <h2><cal:title format="MMMM, yyyy"/></h2>
    <table>
      
<tr><th>Sunday</th><th>Monday</th><th>Tuesday</th><th>Wednesday</th><th>Thursday</th><th>Friday</th><th>Saturday</th></tr>
      <cal:week> 
        <tr>
          <cal:day>
            <td>
              <cal:if-in-month><em><cal:dayofmonth/></em></cal:if-in-month>
                <xsp:logic>while (_esql_query.keepGoing() &amp;&amp; new 
Integer(<cal:dayofmonth/>).toString().equals(<esql:get-date column="event_date" 
format="d"/>.toString( )) ) {
                  <p><esql:get-string column="title"/></p>
                  <esql:next-row/>
                }
                </xsp:logic>
<!--
  <p>bool:<xsp:expr>new Integer(<cal:dayofmonth/>).toString().equals(<esql:get-date 
column="event_date" format="d"/>.toString( ))</xsp:expr></p>
                 <cal:dayofmonth/>
-->            </td>
          </cal:day>
        </tr>
      </cal:week>
    </table>
  </cal:monthly>
</esql:results>
</esql:execute-query>
</esql:connection>
</page>
</xsp:page>

---------------------------------------------------------------------
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