Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Help with Where Clause using CSV file

916328Feb 8 2012 — edited Apr 11 2013
I have the following SQL query:

SELECT
DISTINCT
A.N_LOA,
A.N_COMPNUM,
A.N_MTRSZ_CD,
A.N_ITEMNUM,
A.STATUS,
A.N_METER_SET_DATE,
A.MANUFACTURER,
A.N_MODELNUM,
B.COMMCODE,
B.COMM_NUMBER
FROM
ASSET A, N_METER_TEST_HIST B
WHERE
A.ASSETTYPE = 'ELECTRIC' AND A.SITEID = 'INDIANA' AND A.N_EQTYP_CD = 'METR'
AND A.N_COMPNUM IN ('0986779','0999345','0985123','0912786')
AND A.ASSETNUM = B.ASSETNUM
ORDER BY A.N_COMPNUM

The above query works. However, I am supplied a large (100+) number of meter numbers in a CSV file. Currently I have to cut and paste into this statement. How can I rewrite the where statement so it will read in a CSV file, off my "C" drive for the list of meter numbers?

Any help would be appreciated!!!
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 9 2013
Added on Feb 8 2012
15 comments
4,852 views