473,473 Members | 4,208 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

materialze query?

Hi!

I'm writing a program that interacts with a db2 database through jdbc.
I frequently need to run a quite query q1 that involves several full
outer join of a table with itself. Once q1 is executed I need to
postprocess the result. This postprocessing involves several queries on
the result of q1. I think that the best solution would be to
materialize the result of q1 in the database. How can I do it?

Thanks a lot in advance!

Diego
Nov 12 '05 #1
1 1290

Diego,

may be you check out the following:

- cursor: DECLARE CURSOR FOR 'SELECT ... FROM ...'
then you can fetch the results and moe within your cursor and do your logic
for each result found, can be hold over transaction scope.

- temporary tables: DECLARE GLOBAL TEMPORARY TABLE ...
a temp table which exists within one transaction

- MQT (materialized query table): CREATE TABLE ... AS 'SELECT .. FROM...'
DATA INITIALLY DEFERRED REFRESH IMMEDIATE ...

this calculated table actually does physically exist and will be used when a
user issues a join which is specified in the FROM clause of the SELECT
statement, it can also be accessed directly, just as you declare it.
Refreshing on request or automated possible

choose what is best for you, a MQT is probably best to reuse.
But, if you have to query just once, may be you open a cursor and for each
item you fetch do your processing ?

Hope that helps

Juliane

gordongekko wrote:
Hi!

I'm writing a program that interacts with a db2 database through jdbc.
I frequently need to run a quite query q1 that involves several full
outer join of a table with itself. Once q1 is executed I need to
postprocess the result. This postprocessing involves several queries on
the result of q1. I think that the best solution would be to
materialize the result of q1 in the database. How can I do it?

Thanks a lot in advance!

Diego

--
Message posted via http://www.dbmonster.com
Nov 12 '05 #2

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

Similar topics

2
by: jaysonsch | last post by:
Hello! I am having some problems with a database query that I am trying to do. I am trying to develop a way to search a database for an entry and then edit the existing values. Upon submit, the...
29
by: shank | last post by:
1) I'm getting this error: Syntax error (missing operator) in query expression on the below statement. Can I get some advice. 2) I searched ASPFAQ and came up blank. Where can find the "rules"...
9
by: netpurpose | last post by:
I need to extract data from this table to find the lowest prices of each product as of today. The product will be listed/grouped by the name only, discarding the product code - I use...
3
by: Harvey | last post by:
Hi, I try to write an asp query form that lets client search any text-string and display all pages in my web server that contain the text. I have IIS 6.0 on a server 2003. The MSDN site says...
4
by: Diamondback | last post by:
I have two tables, WIDGETS and VERSIONS. The WIDGETS table has descriptive information about the widgets while the VERSIONS table contains IDs relating to different iterations of those widgets...
14
by: Dave Thomas | last post by:
If I have a table set up like this: Name | VARCHAR Email | VARCHAR Age | TINYINT | NULL (Default: NULL) And I want the user to enter his or her name, email, and age - but AGE is optional. ...
2
by: Dom | last post by:
I need to run a query based on a query in Access. The second query has a number of conditions which all work well, but there is one more contition I need to set to make it run properly. the...
5
by: Ryan Hubbard | last post by:
Is it possible to get the recordset from an open query window? So you run the query. The window is open. Can vba retrieve this data?
0
by: starace | last post by:
I have designed a form that has 5 different list boxes where the selections within each are used as criteria in building a dynamic query. Some boxes are set for multiple selections but these list...
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
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,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
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 ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.