Hi Fred,

yes, this should work (without looking at the other things).

Remember: You can only access a current row value from query 1 within 
the row-results - tag of query 1. Caused by this fact you have to 
specify the second query within the first row-results section.

Try a simple thing:
* make query 1 working standalone
* make query 2 working standalone (without the WHERE!!)
* move query 2 -as it is- into the row-results from query 1
* now insert the where statement as you wrote it

After each step have a look at the result to see what happens.
!!DON'T use  large tables - just believe me ;) !!

Cu
   Harald

[EMAIL PROTECTED] wrote:

> Where do you embed the second query though? do u put it in the
> esql:row-results element of the first query?
> 
> it seems to be ignoring the second query entirely.  I'm using the release
> C2, with xmlns:esql="http://apache.org/cocoon/SQL/v2";
> 
> ie:
>   <page>
>     <content>
>       <esql:connection>
>         <esql:pool>pooledConnect</esql:pool>
>         <esql:execute-query>
>           <esql:query>
>             select dept from department_table
>           </esql:query>
>           <esql:results>
>             <esql:row-results>
>               <list>
>                 <dept>
>                 <esql:get-string column="dept"/>
>                 </dept>
>                 <esql:execute-query>
>                   <esql:query>
>                     select id,name 
>                     from employee_table 
>                     where department_id = <esql:get-string column="dept"
> ancestor="1"/>
>                   </esql:query>
>                   <esql:results>
>                     <esql:row-results>
>                       <employee>
>                         <name><esql:get-string column="name"/></name>
>                       </employee>
>                     </esql:row-results>
>                   </esql:results>
>                   <esql:no-results>
>                     <p>Sorry, no results 2!</p>
>                   </esql:no-results>
>                 </esql:execute-query>
>               </list>
>             </esql:row-results>
>           </esql:results>
>           <esql:no-results>
>             <p>Sorry, no results 1!</p>
>           </esql:no-results>
>         </esql:execute-query>
>       </esql:connection>
>     </content>
>   </page>
> 
> 
> -----Original Message-----
> From: SunnyDay [mailto:[EMAIL PROTECTED]]
> Sent: 16 January 2002 16:03
> To: [EMAIL PROTECTED]
> Subject: Re: [C2] esql: using query results in another query
> 
> 
> <esql:get-string column="id" ancestor="1"/>
> 
> should work
> 
> CU
>    Harald
> 
> 
> Legal Disclaimer 
> 
> This message contains confidential information and is intended only for
> the individual named.  If you are not the named addressee you should not
> disseminate, distribute or copy this e-mail.  Please notify the sender
> immediately by e-mail if you have received this e-mail by mistake and delete
> this e-mail from your system.
> mail transmission cannot be guaranteed to be secure or error-free as
> information could be intercepted, corrupted, lost, destroyed, arrive late or
> incomplete, or contain viruses.  The sender therefore does not accept
> liability for any errors or omissions in the contents of this message that
> arise as a result of e-mail transmission.  If verification is required
> please request a hard-copy version.  This message is provided for
> informational purposes only.
> our website at: http://www.widelearning.com
> 
> Wide Learning is a trading name of Wide Multimedia Ltd Registered office:
> 33-41 Dallington Street, London EC1V 0BB
> Company number: 3339664 VAT number: 690 8399 83
> 
> 
> ---------------------------------------------------------------------
> 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]>
> 
> 



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