RE: Trying to avoid using the IN Clause in SQL statment
"David, Romeo B. (Govt)" <[email protected]>
| Newsgroups | gmane.comp.db.oracle.devel |
|---|---|
| Message-ID | <LYRIS-1796914-803891-2002.12.16-16.39.54--gcdod-oracle#[email protected]> |
Try this from asktom website: http://asktom.oracle.com/pls/ask/f?p=4950:8:1733893::NO::F4950_P8_DISPLAYID, F4950_P8_CRITERIA:110612348061,%7Bin%7D%20and%20%7Binstead%7D%20and%20%7Bof% 7D%20and%20%7Bexists%7D -----Original Message----- From: [email protected] [mailto:[email protected]] Sent: Friday, December 13, 2002 2:07 PM To: Oracle Subject: [oracle] Trying to avoid using the IN Clause in SQL statment I have an ASP page that allows a user to submit a text file that is composed of one column of say... inventory stock numbers. I grab the file and retrieve the numbers. I then want to query several tables in an Oracle 8.1.7 database for information for these values. I currently have designed the SQL like this. "SELECT sometable.something, othertable.otherthing FROM sometable, othertable WHERE stockNumber IN ('VAL1','VAL2'.....)" I realize this is inefficient for a large qty of "VALs" so I have limited the size of the file the user can submit however this is not a long-term solution. I am looking for some advice on maybe creating a temporary table and inserting the values into the table where then I can run queries against it efficiently. I know I could create table and "INSERT INTO .... VALUES ( ... )", but is there an even better approach. Suggestions would be greatly appreciated. --- Change your mail options at http://p2p.wrox.com/manager.asp or to unsubscribe send a blank email to %%email.unsub%%. --- Change your mail options at http://p2p.wrox.com/manager.asp or to unsubscribe send a blank email to [email protected].