473,815 Members | 3,617 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Retrieving an Answer from Mulitple ResultSet statements

I have several ResultSet Querys/Statements within my page. An example
of the code looks like this:

ResultSet rs1 = stmt1.executeQu ery("SELECT right('
' + '$' + convert(varchar ,SUM(ActivePrim ),1), 15) AS 'ActivePrim',
right(' ' + '$' + convert(varchar ,SUM(KGAP),1), 15) AS
'KGAP', right(' ' + '$' +
convert(varchar ,SUM(PrimaryRep o),1), 15) AS 'PrimaryRepo', right('
' + '$' + convert(varchar ,SUM(WeeklyTota l),1), 15) AS
'WeeklyTotal' FROM Intranet..Insur anceStats WHERE EmployeeName =
'Jamie' and Date BETWEEN '01/01/04' and '01/31/04'");

What would be the correct way to retrieve each result set? I
currently have it as the example below. But this doesn't allow for
each result set to be displayed separately.

<td valign=top><b>A ctive Primary:</b><%= ActivePrim %></td>

Any help would be greatly appreciated.

Catherine
Jul 20 '05 #1
1 1399
cl******@nuvell .com (Catherine) wrote in message news:<a0******* *************** ****@posting.go ogle.com>...
I have several ResultSet Querys/Statements within my page. An example
of the code looks like this:

ResultSet rs1 = stmt1.executeQu ery("SELECT right('
' + '$' + convert(varchar ,SUM(ActivePrim ),1), 15) AS 'ActivePrim',
right(' ' + '$' + convert(varchar ,SUM(KGAP),1), 15) AS
'KGAP', right(' ' + '$' +
convert(varchar ,SUM(PrimaryRep o),1), 15) AS 'PrimaryRepo', right('
' + '$' + convert(varchar ,SUM(WeeklyTota l),1), 15) AS
'WeeklyTotal' FROM Intranet..Insur anceStats WHERE EmployeeName =
'Jamie' and Date BETWEEN '01/01/04' and '01/31/04'");

What would be the correct way to retrieve each result set? I
currently have it as the example below. But this doesn't allow for
each result set to be displayed separately.

<td valign=top><b>A ctive Primary:</b><%= ActivePrim %></td>

Any help would be greatly appreciated.

Catherine


You'll probably get a better answer to this in an ASP forum.

Simon
Jul 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
2531
by: Ralph Freshour | last post by:
I'm not sure the follow multiple table query is the right way to do what I need to do although it seems to be working: $php_SQL = "SELECT * ". "FROM basics, personal, photos ". "WHERE basics.member_name = personal.member_name ". "AND basics.member_name = photos.member_name ". "AND basics.account_creation_date >= DATE_SUB(NOW(), INTERVAL 30 DAY)";
1
1552
by: evetommy | last post by:
Hi all, I'm trying to retrieve fields from my database with following mysql statement: $query = SELECT g_games.Title FROM g_collections, g_personal_reviews, g_games WHERE (g_games.ID=g_personal_reviews.G_ID AND g_collections.U_ID = '" . $data1 . "' AND g_personal_reviews.C_ID = '" . $data2 . "' ) "; $resultset = mysql_query($query);
2
1795
by: Savas Ates | last post by:
I have a stored procedure below.. When I run it with a well parameter in query analyser 3 of select statements return me. (i named select statements 1,2,3) But in asp page when i call this procedure same as query analyser it returns me 2 select statements value? what is the problem ? CREATE PROCEDURE ST_25INDIRIM @sesid BIGINT AS
6
12447
by: VMI | last post by:
How can I execute a "Select" query from C# so that it only returns an integer with the amount of rows that the actual query is supposed to return? I don't want the whole result set. Thanks.
3
2171
by: Joe via DotNetMonster.com | last post by:
Hi, I'm trying to use several select statements so that I don't need to call the function several times. The next Result set always seems to read the first select statement. I have the following: Dim queryString As String = "SELECT TOP 1 (.), . FROM WHERE (. = @LessonID) AND .='Motivate'; SELECT TOP 1 (.), .
5
1983
by: Sanjay Pais | last post by:
I have a table with over 1.3 million rows. I am retrieving only 20 at a time using the with - over clauses In query analyser, the data is retrieved in under a second. When retrieving using the data adaptor.fill or datareader to retrieve the data it takes over 24 seconds. public System.Data.SqlClient.SqlDataReader List1(int PageIndex, int PageSize, string ItemName, string UserIDs, DateTime DateStart, DateTime DateEnd, int status,...
13
14601
by: ajos | last post by:
hi frnds, im doing some db related operations in my web project,im using mysql 5.0,i have the following piece of code in my action class- for(resultset = statement.executeQuery(s2); resultset.next();) { s10 = resultset.getString(1); s11 = resultset.getString(2); s12 = resultset.getString(3); } resultset.close();
1
1293
by: oaklander | last post by:
Is it okay to keep creating queries with the same ResultSet Object reference (results)? Here is what I am currently using in my Database statements with Oracle and everything works but was wondering if this is okay where I am using ResultSet results for 3 queries in my Tomcat container: ResultSet results = null; Statement statement = null; ...... statement = connection.createStatement(); results =...
2
2183
by: gophersounds | last post by:
When I run this simple program I am not getting any data back. The program creates a database, creates a table, populates the table with some data, and then tries to read the data. However, no records are returned in the ResultSet. I verify through MySQL Query Browser that the database is created and populated. I've also been unable to retrieve records with other databases. Because I'm creating the database at the root I don't think admin...
0
10670
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10408
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10142
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9225
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7686
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5570
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5708
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4358
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3886
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.