Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Can you use a cursor variable in a WHERE..IN Statement??

Re: Can you use a cursor variable in a WHERE..IN Statement??

From: Beginner <oracle_at_epicentre.fr>
Date: Fri, 14 Jun 2002 14:30:08 +0200
Message-ID: <aecngg$jbm$1@wanadoo.fr>


Bonjour,

Vous pouvez utiliser le package DBMS_SQL et définir dynamiquement vos curseurs.




Très cordialement
Denis Jeanneret - Directeur Technique, Division ORACLE Epicentre - 529 Route des Vernes 74370 PRINGY
Tel: 04.5009.7000
Fax:04.50.66.92.19
web: www.epicentre.fr
----------------------------------------------------------------------------
------------------------------



"Michael Green" <DMichaelFSU_at_hotmail.com> wrote in message news:70aba55c.0206131231.24ac1535_at_posting.google.com...
> Hi. I am trying to see if it is possible to use a cursor as the list
> of a WHERE..IN statement.
>
> I have 20+ tables that hold hourly data for 7500+ different objects.
> I need to come up with a daily summary of the data in the 20+ table
> for each object. The 20+ tables only contain data and a key. A
> table, ENTRY_ID, relates the key to the date, time, object's name,
> etc. I am currently trying to use a cursor to query the ENTRY_ID
> table to get a list of keys for a particular object on a particular
> date and use that result set to summarize data in the rest of the
> tables. This way I only have to query ENTRY_ID once, not 20+ times
> for each of teh 7500 objects.
>
> Eg: Replace this query:
> SELECT sum(t1.col1), sum(t1.col2), ...
> FROM table1 t1
> WHERE t1.id IN (SELECT e1.id
> FROM entryid e1
> WHERE e1.aDate = <date>
> AND e1.obj = '<str>');
>
> with something like this:
> SELECT sum(t1.col1), sum(t1.col2), ...
> FROM table1 t1
> WHERE t1.id IN (id_cur)
>
> How to setup up the cursor id_cur correctly to accomplish the same
> thing. Or is it possible? Or is there a different way?
>
> Any and all help would be greatly appreciated. I am using Oracle
> 8.1.7 on Solaris 8
>
> ~~Michael
Received on Fri Jun 14 2002 - 07:30:08 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US