You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Alfredas Chmieliauskas <al...@SSERIGA.edu.lv> on 2000/09/20 18:29:05 UTC

SQL question: suggestions welcome...

Hi,

I have two SQL queries in one page, one of which has to return the general
info about the page (last edited, absolute location, author, etc)  the other
query has to form a links menu in a page according to the result of the
previous (eg. that every "author" could see his "own" menu).
<page>
.................
<query connection="mysql_connection" doc-element="page_info"
row-element="info">
	select title, context, page_author, date_edited, page_background
from page_info
</query>
<query connection="mysql_connection" doc-element="page_menu"
row-element="menu_item">
	select item_name, item_link, item_author, item_image from page_menu
where item_author=.......(how to pass the value page_author from the
previous query, if it is possible???).....
</query>
...............
</page>

alfredas



Re: SQL question: suggestions welcome...

Posted by Donald Ball <ba...@webslingerZ.com>.
On Wed, 20 Sep 2000, Alfredas Chmieliauskas wrote:

> 
> Hi,
> 
> I have two SQL queries in one page, one of which has to return the general
> info about the page (last edited, absolute location, author, etc)  the other
> query has to form a links menu in a page according to the result of the
> previous (eg. that every "author" could see his "own" menu).
> <page>
> .................
> <query connection="mysql_connection" doc-element="page_info"
> row-element="info">
> 	select title, context, page_author, date_edited, page_background
> from page_info
> </query>
> <query connection="mysql_connection" doc-element="page_menu"
> row-element="menu_item">
> 	select item_name, item_link, item_author, item_image from page_menu
> where item_author=.......(how to pass the value page_author from the
> previous query, if it is possible???).....
> </query>
> ...............
> </page>

try using xsp and the new esql logicsheet - it lets you do nested queries
and lets the inner queries refer to the results of the outer
queries. there's an example in samples/sql/esql.xml.

- donald