Sql Developer conditions from Excel

110 views Asked by At

I have around 15.000 conditions in excel. And I want to read this condition and write into "where in" clause on sql developer. Is it possible?

1

There are 1 answers

0
Hawk On

First, you can easily import the usernames from excel file into Oracle table. Assuming the Oracle table temp has the column logins where 1500 records stored in it, then you can build your query as follows:

SELECT *   
FROM temp  
WHERE logins IN ('user1', 'user2', ...., 'user1000')  
OR logins IN ('user1001', 'user1002', ...., 'user2000')   
OR ....  
OR logins IN ('user14001', 'user14002', ...., 'user15000');  

I know this is not efficient as might need. But I cannot recall any other method. There are some tools you can use to convert all these 15K values in OR options (put them in single quotes with comma).