Hi,
I'm not sure but I don't think so... because you have a JDBC statement and
you want that JDBC statement to execute multiple queries. You could however
do something like that:
<% Vector result1 = new Vector(); %>
<sql:statement id="stmt1" conn="conn1">
<sql:query>
select * from somewhere
</sql:query>
<sql:resultSet id="rset1">
<% result1.add(rset1.getObject(1)); %>
.............
</sql:resultSet>
</sql:statement>
<% for(int j = 0; j<result1.size(); j++)
{ %>
<sql:statement id="stmt2" conn="conn1">
<sql:query>
select * from somewhereelse
where something = <%=resut1.elementAt(i)%>
</sql:query>
<sql:resultSet id="rset2">
<sql:getColumn position="1"/>
<sql:getColumn position="2"/>
...............
</sql:resultSet>
</sql:statement>
<% } %>
I haven't try the code but I think you still might have problems... because
you are actually declaring more than 1 statement with the name "stmt2"... If
it's a problem I think you should change the code. Try to make only one
query...
select a.name, b.salary from pers a, wage b
where a.kids = (select . . . . )
With a query like that, you should have no problems at all...
Mihai Manuta
[EMAIL PROTECTED]
tel: 06.73.56.57.92
-----Original Message-----
From: Quaini Michele [mailto:[EMAIL PROTECTED]]
Sent: Friday, May 04, 2001 12:06 PM
To: '[EMAIL PROTECTED]'
Subject: jdbc taglib:nested queries
Hi,
Suppose that I want to do the following thing:
1) creating a query query1 that identifies n records.
2) looping on the resultset of query1 and for each record
2.1) making another query query2
2.2) printing results of query1 and query 2.
Is it possible with JDBC taglibs? and if yes, could
anyone show an example?
Thanks
-- Michele
-----Original Message-----
From: Enoch Ha [mailto:[EMAIL PROTECTED]]
Sent: venerd� 4 maggio 2001 4.45
To: [EMAIL PROTECTED]
Subject: unsubscribe request
unsubscribe request
_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.