473,396 Members | 1,689 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

How to return single resultset with multiple database queries

Hi All.
This might be the wrong group to post this query, since it is ADO.NET
related, but I couldn't find any ADO.NET group.

My problem is that I want to write some queries, which use temp table
because of their complexity. My final results are in the temp tables.

How can I return a single result set from these multiple queries?

Regards,
--Jaffar

Nov 5 '07 #1
2 5552
Just do a select. The ADO.NET library will populate a DataSet
DataTables with one table for each SELECT statement. Just make those
select statements come from the temp tables.

Not sure that selecting from temp tables would be good practice though
- they're (re)created in the temp database every time. Is there no
way you can either populate a "live" scratch table, or maybe even
break your logic down into more simple joins on existing tables? I'm
guessing you're using cursors to generate the results?
On Nov 5, 7:25 am, jaffar.k...@gmail.com wrote:
Hi All.
This might be the wrong group to post this query, since it is ADO.NET
related, but I couldn't find any ADO.NET group.

My problem is that I want to write some queries, which use temp table
because of their complexity. My final results are in the temp tables.

How can I return a single result set from these multiple queries?

Regards,
--Jaffar

Nov 5 '07 #2
<ja*********@gmail.comwrote in message
news:11**********************@d55g2000hsg.googlegr oups.com...
Hi All.
This might be the wrong group to post this query, since it is ADO.NET
related, but I couldn't find any ADO.NET group.

My problem is that I want to write some queries, which use temp table
because of their complexity. My final results are in the temp tables.

How can I return a single result set from these multiple queries?
It would help if you specified the DB you are using. Its easy for use to
draw a whole bunch of assumptions from what you posted which may be wildly
inaccurate. Its not east to tell your level of skill with SQL.

For example by temp table do you mean a) Tables you've created in the DB to
temporarily receive results, b) #temp SQL server tables, c) DECLARE @Temp
TABLE ... SQL Server Table types OR d) somethine else altogether?

It may be that all you need is to understand how to use JOINS and UNIONS in
SQL better.

--
Anthony Jones - MVP ASP/ASP.NET
Nov 6 '07 #3

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

Similar topics

1
by: Top Gun | last post by:
In order to avoid multiple trips to the database, I would like to fill several tables in a DataSet with a single call to a stored procedure that will return resultsets for the appropriate tables. ...
4
by: DG | last post by:
Hi, Can anyone advise how to execute multiple statements in a single query batch. For example- update customers set customer_name = 'Smith' where customer_name = 'Smyth'; select * from...
3
by: Paul Janssen | last post by:
Hello! Can anyone help me out with the following situation: (a) a single query with 550 id's in the IN-clause resulting into 800+ seconds; (b) 550 queries with a single id in the IN-clause...
7
by: Gandalf | last post by:
Hi all, I am connecting to DB2 8.1 on Solaris through JDBC type 4 drivers (driver: com.ibm.db2.jcc.DB2Driver). Problem is that when a cursored query is done, the resultset gets closed after...
0
by: MHenry | last post by:
Hi, I know virtually nothing about creating Macros in Access. I would appreciate some help in creating a Macro or Macros that automatically run(s) 14 Queries (three Make Table Queries, and 11...
4
by: Jeff | last post by:
We have multiple ASP.Net web apps in development. As a standard we are looking to go with SQL Server to hold state information. Can we have the multiple apps all point to a single State DB? Or...
4
by: dreaken667 | last post by:
I have a MySQL database containing 16 tables of data. Each table has a different number of columns and there are few common field names accross tables. I do have one master table with which I connect...
1
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...
5
by: =?Utf-8?B?TWlrZSBE?= | last post by:
This is a difficult question: I need to be able to input data via hand-scanner into a web page textbox, but it needs to be done more than once. The user will scan one card after another and in the...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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,...
0
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...
0
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,...

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.