So I can't create or edit tables (I'm a user with read only permission) and I want to look up 10,000 unique id's. I can't put them inside of an IN() statement because oracle limits over 1000 items.
Is it possible to select this entire list from the DUAL table in oracle? Something like:
select
'id123,id8923,id32983,id032098,id308230,id32983289'
from DUAL
Use a collection (they are not limited to 1000 items like an
INclause is):SYS.ODCIVARCHAR2LISTandSYS.ODCINUMBERLISTare collection types that are supplied in theSYSschema.You can join this directly to whichever table you are
SELECTing from without needing to use theDUALtable:If you can get a collection type created then you do not even need the
TABLEexpression and can use it directly in theWHEREclause using theMEMBER OFoperator:You can even pass the values as a bind parameter - see my answer here