Hi Maxime Assuming that the second query is in the same XSP document as the first, you can do this by nesting the queries as sketched below. The essential things to note:
1. The nested-query is a regular <esql:execute-query> element, placed within the an <esql:row-results> element. It's syntax is identical to a normal query. (You may be able to place the nested query within other elements - this is the only one that I have needed to use.) 2. You can refer to any of the selected columns in a parent query by adding an ancestor attribute to the <esql:get-xxx> tag: e.g. <esql:get-string column="id" ancestor="1" /> Hope this helps, Richard ....//... <esql:connection> <esql:pool>MyPool</esql:pool> <esql:execute-query>select id from MyOtherTable where...</esql:execute-query> <esql:results> <esql:row-results> <esql:execute-query>select * from MyTable where ID='<esql:get-string column="id" ancestor="1" />'</esql:execute-query> <esql:results> ....//... </esql:results> <esql:row-results> </esql:results> </esql:connection> ...//... ----- Original Message ----- From: <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, February 26, 2003 9:10 AM Subject: How to set an ESQL value into a variable? Hi, I make a connection (using ESQL) and get a value <esql:get-string column="MYVAR"/> . How can I get this value on the page to build another query like : Select * From mytable where ID = "MYVAR" I tried with <xsp:attribute name="MYVAR"><esql:get-string column="MYVAR"/></xsp:attribute> But when I request it I get the error : variable MYVAR not defined. Even if I add <xsp:logic> Int MYVAR = 0; </xsp:logic> How can I put my ESQL value into a variable? --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]