You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by er...@eunet.at on 2000/05/19 22:17:09 UTC

Multiple SQL Queries?

Hi,

I am working with the SQL-Processor and the taglib to connect Cocoon to a database. It works great, but I can not figure out how to use more than one query in
a page. so that the resulting XML-File (before any style transfromation) looks like

<ROWSET1>
<ROW> 1st Query. Results bla bla bla </ROW>
<ROW>...................</ROW>
</ROWSET1>


<ROWSET2>
<ROW> This is produced by the 2nd query </ROW>
<ROW>........</ROW>
<ROW>...</ROW>
</ROWSET2>


Of xourse, it need not to be named <ROWSET1>  and <ROWSET2>, this is just an example. I just want to have different tags for the different queries, so that
they can be formatted completly different.  I want to  populate 2 tables with different data. (For instance a list of all books in one table and a list of all
cds in another).


Tx,

Ernst


(ernst nusterer, ernst.nusterer@eunet.at)



Re: Multiple SQL Queries?

Posted by Ulrich Mayring <ul...@denic.de>.
ernst@relay2.austria.eu.net wrote:
> 
> Of xourse, it need not to be named <ROWSET1>  and <ROWSET2>, this is just
> an example. I just want to have different tags for the different queries,
> so that
> they can be formatted completly different.  I want to  populate 2 tables
> with different data. (For instance a list of all books in one table and a
> list of all
> cds in another).

I'm not sure about the taglib, but with the SQL Processor:

<first><query ...>...</query></first>

<second><query ...>...</query></second>

Note that the rowsets of both queries will have the same name (ROWSET or
whatever you specified), but you can tell them apart by the surround
first and second tags.

Ulrich

-- 
Ulrich Mayring
DENIC eG, Systementwicklung

Re: Multiple SQL Queries?

Posted by er...@eunet.at.
Donald,

thank you very much for your help!! I tried it before I sent a mail to the
list,, but obviously, I made a mistake. Thanks to your help, it works great
now!


Cheers,
Ernst


Donald Ball wrote:

> On Fri, 19 May 2000 ernst.nusterer@eunet.at wrote:
>
> > Hi,
> >
> > I am working with the SQL-Processor and the taglib to connect Cocoon
> > to a database. It works great, but I can not figure out how to use
> > more than one query in a page. so that the resulting XML-File (before
> > any style transfromation) looks like
> >
> > <ROWSET1>
> > <ROW> 1st Query. Results bla bla bla </ROW>
> > </ROWSET1>
> >
> > <ROWSET2>
> > <ROW> This is produced by the 2nd query </ROW>
> > </ROWSET2>
> >
> > Of xourse, it need not to be named <ROWSET1> and <ROWSET2>, this is
> > just an example. I just want to have different tags for the different
> > queries, so that they can be formatted completly different.  I want to
> > populate 2 tables with different data. (For instance a list of all
> > books in one table and a list of all cds in another).
>
> Is very easy - you just put one than one query or sql:execute-query
> element on the page. Magically, the processor or taglib will operate on
> both of them.
>
> - donald


Re: Multiple SQL Queries?

Posted by Donald Ball <ba...@webslingerZ.com>.
On Fri, 19 May 2000 ernst.nusterer@eunet.at wrote:

> Hi,
> 
> I am working with the SQL-Processor and the taglib to connect Cocoon
> to a database. It works great, but I can not figure out how to use
> more than one query in a page. so that the resulting XML-File (before
> any style transfromation) looks like
> 
> <ROWSET1>
> <ROW> 1st Query. Results bla bla bla </ROW>
> <ROW>...................</ROW>
> </ROWSET1>
> 
> 
> <ROWSET2>
> <ROW> This is produced by the 2nd query </ROW>
> <ROW>........</ROW>
> <ROW>...</ROW>
> </ROWSET2>
> 
> 
> Of xourse, it need not to be named <ROWSET1> and <ROWSET2>, this is
> just an example. I just want to have different tags for the different
> queries, so that they can be formatted completly different.  I want to
> populate 2 tables with different data. (For instance a list of all
> books in one table and a list of all cds in another).

Is very easy - you just put one than one query or sql:execute-query
element on the page. Magically, the processor or taglib will operate on
both of them.

- donald