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 -> Select multiple rows from DUAL ?

Select multiple rows from DUAL ?

From: <andy.malakov_at_gmail.com>
Date: 7 Jan 2005 11:45:35 -0800
Message-ID: <1105127135.680598.193460@f14g2000cwb.googlegroups.com>


I need to synchronize in-memory cache of objects with database. One of the things I have to check is that each loaded object still exists in the database. To do that I perform queries like:

SELECT pk FROM sometable WHERE pk IN (...);

After that I subtract result set from the set of loaded primary keys to get list of deleted objects that have to be purged from memory.

Problem: Query that I use returns set of existing objects, but in my application deletes are not very frequent. In other words, usually result set consist of the same set of primary keys that I use as query input. I would like to change that query to return only set of *non-existing* primary keys. I need something like the following (wrong) SQL:

SELECT (10, 20, 30 )
MINUS
SELECT pk FROM sometable WHERE PK IN (10,20,30);

I cannot put input set into some table because query must allow concurrent use. I would also like to avoid using a stored procedure unless it could be very generic.
Any other ideas will be great!

Thanks,
Andy Received on Fri Jan 07 2005 - 13:45:35 CST

Original text of this message

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