Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Question about use of temp tables in Oracle...
Message
De
01/09/2002 13:48:40
 
 
Information générale
Forum:
Oracle
Catégorie:
Autre
Divers
Thread ID:
00694954
Message ID:
00695793
Vues:
12
Larry,

Thanks for your answers, especially on the GLOBAL TEMPORARY KEYWORDS. I also picked up SQL IN A NUTSHELL by O'Reilly Press, which does a decent job of covering the differences in implementation of specific commands.

The way we planned to use #TEMPTABLES was just for the duration of the transaction or query process. Again, if a user has selected 10 accounts and 100 products for a report (or 50 accounts/2 products, etc.), we build #TEMPTABLES in SQL containing the keys for the accounts/items selected by the user. The query does a JOIN against the #TEMPTABLES, and then DROPS the #TEMPTABLES at the end. Since #TEMPTABLES are specific to the connection/user, we can have dozens of users doing this at once.

(The #TEMPTABLES only last for a few seconds...they're basically a way of telling SQL Server which accounts and items to join on. I get dozens of questions asking, 'why don't you just include the accounts and items in-line in the query?' Problem is that the join could be on hundreds of accounts/items.)

From what you're telling me, we can do the same general thing in Oracle, except with different syntax. I can live with coding different syntax in the middle-tier, so long as the general approach we're taking can be the same.

Unfortunately, I just learned that SELECT...INTO doesn't exist in Oracle. That one hurts, because I was using SELECT...INTO during a query process to bring back multiple result sets...

Yes I agree with your suggestion, we need to check for the presence of the tablename before creating it.

On the question of using SPs...I'd love to, even just for those areas in Oracle / SQL Server that are the same. The problem is that some of our potential business partners who have had to support Oracle and SQL Server have spooked our company president and senior VP from using stored procs. Usage of them in the database back-end has been equated with non-portability. Our project/database managers (most of whom have SQL Server clients, but one or two may have Oracle clients in the next year) have said that they won't participate in managing different stored procs for different back-ends...that the developers should code for it in the middle-tier.

So we have to do all the database stuff in the middle-tier with pass-through, etc. It sucks, it royally sucks, and I'm totally ticked off that I'm being told basically that I can't optimize for performance. But...that's the situation I'm in. If you have any advice, I'm all ears!

Thanks again,
Kevin
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform