473,322 Members | 1,409 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,322 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 5551
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: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.