If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Oracle > table variable or collection

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 07-13-12, 15:30
rajeshrajdaan rajeshrajdaan is offline
Registered User
 
Join Date: Jul 2012
Posts: 2
table variable or collection

Dear all

--I have union query in each union there are few common tables , so i want to keep the result of this common tables in temp table and then want to use them in different union.
--i have one sp(stored proc) which brings two result sets both query have few comman tables, so i want to keep the result of this common tables in temp table and then want to use them in two different
query in same sp(stored proc).

please note: i do not want to use global temp tables.
yours sincerely.
Reply With Quote
  #2 (permalink)  
Old 07-13-12, 16:15
anacedent anacedent is offline
Registered User
 
Join Date: Aug 2003
Location: Where the Surf Meets the Turf @Del Mar, CA
Posts: 7,090
use a view & avoid duplicating data
__________________
You can lead some folks to knowledge, but you can not make them think.
The average person thinks he's above average!
For most folks, they don't know, what they don't know.
Reply With Quote
  #3 (permalink)  
Old 07-16-12, 06:27
dayneo dayneo is offline
Registered User
 
Join Date: Oct 2002
Location: Cape Town, South Africa
Posts: 251
Lightbulb

I see developers trying to "cache" data all the time. My advice is, don't try to cache the data yourself. Write your SQL to solve the query each time. Oracle has a really out of this world data caching mechanism that works much better than anything that you will come up with.

I would recommend that you read Oracle Database Concepts: Buffer Cache which will give you some idea of how Oracle "caches" your data for you.
I would seriously recommend you get your hands on a book by Tom Kyte called Exper Oracle Database Architecture, in particular chapter 4 on memory structures. He explains it all very well.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On