Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using file as parameter for query

Status
Not open for further replies.

metalboy

Technical User
Apr 1, 2004
97
GB
I have a query:
Code:
SELECT LHENDT, MQUSER, COUNT(*), ITEGNG  FROM HDPULSE4DX  WHERE (ITSTAT = 'N' AND ITENNG = 0 AND (LHJUCG = 'A' AND LHJVCG IN ('ED','RDH','RGJ','RGD','RGC','RHH','RIH','RKC','RLC','RMC','RNC','RNF','RNG','ROH','RPC','RPV','RPW','RQC','RQD','RQE','RQF','RQG','RQH','RQI','RQJ','RQK','RQL','RQM','RQN','RQO','RQP','RQQ','RQR','RQS','RSC','RSO','RSW','RUC','RUQ','RUV','RVH','RXT','RZH','RHA','RCG','RHB','RHC','RUG','RKA','RLA','RNB','RIB','RUB','RTB','HIT','RPB','RQE','RQJ','RQB','RRB','RQF','RRB','RQO','RXB') OR LHJUCG = 'D' AND LHJVCG IN ('TW','QW','Q8','Q2','87','88','YU','QY','QLP','QLQ','KIP','QZ','QJ')) AND LHENDT = 1041201 AND MQUSER IN ('BEASLEC','BIRDA','BRAITHM','HARPERS','HILLMI','HODGSOL','HUGHESD','JONESV','LAMBERD','POSTULT','RICKETG','WALSHK','AKTARN','ALOMATL','ATKINSG','AUSTIND','BARSBYH','BARTONB','BENNETM','BEVERLJ','BYRNEJ','CHANDOM','CHANDRS','COLLINA','CUNNIND','DEWERR','DUBREYR','FIELDSA','GODDARB','GOLDINE','GOODWIN','HENSONCL','HILLN','HOGDOK','HUSSIAMA','IYAYIF','JACKT','JANUS','JOHNSOC','LAMBERM','LOVEF','LOVESA','MARRIOC','MARSHAC','MARSHAL','MAYS','METCALW','MISTERJ','NOALLS','PAVIERC','PELLINL','PHIPPST','PURNELD','RAWSONP','RICHARJ','ROBINSC','RUSSELD','SALIMM','SANKEYC','SCOTTL','SCUWANS','SMALLN','SMITHCHA','SWIFTA','TANNAHI','TAYLORM','TOMASEJ','VARLEYJ','WHITEMI','WHITTAN','WILKINS','WILLIAG','WRIGHTE','ZAFFARR','WOODWAC','ADDAMDA','ADDISOS','AKBARR','AMOSM','ANDERSA','ARMSTRE','ARNUEVM','ASGHARSA','AZADM','BAILEYE','BARTLER','BENNETA','BENNETK','BLUNTR','BOYKOM','BRADLEA','BRADLER','BREALEK','BROMBYH','BROWNP','BROWNT','BRUCEL','BURTONA','CAMPBELS','CHANJ','CLARKEJ','COXR','COXV','CUFFEM','DAVIESHE','DELMERS','DIXONS','DOVEC','EDGARD','EVANSRE','FAROOKS','FOUNTAS','GALLAGS','GALLOWR','GOODINR','GRICES','GRIFFIM','HALEEMS','HARRISRA','HARRISSA','HARTJ','HAYDENC','HAYDENG','HAYWOOC','HAYWOOC','HENESH','HICKLIT','HODGESJ','HOPKINR','ILLINGL','ILYASA','INGLETS','INGRAMJ','IRELANE','JACKSOD','JACKSOK','JOHALS','KEANEE','KILKIES','KINGS','KINGSO','KIRKL','KOUSERS','LAIRDS','LALA','LANKESF','LEWISP','LIGHTFC','LIMUMBB','MAJANIR','MALHIR','MAMHOOS','MANNK','MARTINH','MARTINH','MCCULLD','MILLSDA','MORLEYH','MORTIMT','MUHUNDM','NARDONC','NATTRAJ','NEEDHAS','NEWBOLG','NICHOLL','ORGILLS','PAGER','PATELM','PATELR','PICKERN','POINTOV','POWELLA','PRIORC','RAMSDAR','RAZAKA','RAZAQUN','REDPATK','RUPRAR','SANDHUD','SANDHUS','SAOULIN','SAOULIN','SHAHZAN','SHARMAA','SHARMAK','SINGHV','SMITHCHRI','SMITHN','SMITHSE','SOANESR','STAFFOM','STATHAAL','STEVENG','SUMMERC','SURGEYS','SWANM','TATTERA','TOMLINK','TOMLINL','WAITESK','WALTERD','WHITEK','WILLIAC','WINFIEC','WOODERC','WRIGHTT','YAQOOBP','ALBONA','BOORMAA','BROWNY','CLARKES','CLARKJA','DAVENPM','HARSEIM','KARIMY','SEATONV','WELSHA','WHITEM','WILSONMI','AMOSN','ARMESA','ASTLEM','AUSTINE','BENNETAN','BULLG','BURNSN','BURTOND','BYRNEP','CARTERMI','CHARLEC','CHOCHOA','CHOCHOS','CHRISTNI','CLARKET','EVERETR','FENNELM','GEET','GODFREV','GOODBAS','HALLAMB','HALLAMM','HARVEYL','HOWELLE','HURHANP','HUSSAISHA','JACKSOLE','KEYWOOC','LEWISMA','MAPPR','MCCLUSM','MCKECHH','MILEST','MILLARH','MILLSV','MUNIRM','ONEILLF','PERRINS','PILSWOB','PRESLAH','RICHARDY','SANDLED','SIMAKG','SMALLH','SMITHL','STAPLER','THOMPSDE','TOPLEYJ','WALLISJ','WALSHC','WELLIND','WILSONHO','WILSONKE','ZAHOORN','ADONISA','ASHMORN','AYUBA','BABERA','BALJ','BARKERAD','BASHKUB','BENNICL','BIRKR','BRIDGEE','BRITOND','BROWNL','BUTLERK','BUTTS','BYFIELD','CAMPBEV','CAUDWES','CHOUDHN','CHOUDHNA','CLUTTET','COXC','DAVIESC','DEANA','DEERS','DEMPSEA','DESAIJ','DHUPHAR','EATONR','EBANKSC','EMERSOJ','ERIBAKT','EVANSLO','EYOA','FAIRMAP','HALAMP','HALLF','HANIFM','HARINAD','HARRISSH','HAYERG','HAZIMEG','HITCHL','HOOLEYJ','HUDSONN','HUSKINS','HUSSAINM','JACKSODE','JACKSON','JEGEDET','JOBEF','JOHNSOP','KHANA','KHANR','KINSEYM','LAWLORN','LEMPARM','LIUJ','MADDEND','MAKATIN','MARRIOJ','MAYFIEN','MCARDLC','MCCRERL','MIDDLEJ','NADIAS','NEALK','NIXONS','NORRYG','PADDAMA','PALMERT','PARKERLE','PHILIPJ','RAFIQG','RAHMANZ','REDMONC','ROSEC','ROUSEA','SACHDES','SACKLEA','SHAKEEM','SHARMATA','SHEPERM','SLATERM','SMYTHC','STURNUK','THOMPSN','TOLMIEL','TUTIND','VADEHRD','WARRENJ','WATSONN','WEBBC','WEIGHTJ','WIGGINS','WILCOXB','WORTHYS','ZALPURM','BEAVISR','BEIRNEA','CHARLEK','HACKINJ','HANDLEJ','HUDSONMA','JARVISC','RAFIQK','SANKEYRU','SIMJ','THOMSOJ','WEBERM','WRIGHTA','BERNARB','BREALEJ','BROOKSI','BROWND','CHOUDHNAH','CULLENJSM','DRINKWJ','ENGLISN','FOSSN','GRANTA','HEALC','HODGESG','HUGHESGSM','NAWAZB','NUTTALE','PITTERR','REDMONL','RIEDK','ROBERTM','SCOTTC','SMITHPE','WILSONJ','AHMEDSH','ALIS','ALISH','ALLENM','BEGUMN','BESTA','BLAKEE','BOOTA','BRITTONM','BROWNJO','BUTLERS','CARES','CAUNTE','DAVIESJ','DAVISOHO','DUNCANB','FLYNNRE','FORSOND','GOODIEP','HAMMONL','HANNISL','HARRISK','HECTORK','HORNERD','HOWELLJ','HUCKLEJ','INKSTER','JOHNSTS','KHANASI','KHANL','LARAGYG','LONGHK','MAHMOOWA','MARSHAT','MARTINA','MEEM','MOHAMMS','MOOREST','MORTONP','MURRAYL','NEWSTEA','PARKERV','PULFORL','RASIBM','SELBYH','SINGHH','SISSONE','SMITHE','SOWEMIW','STRAWL','TURNERK','WAPLINM','WARDLY','WATSOND','WIDDOWH','WILLISW','AMOSS','BEARDH','BURGING','BURTONT','DUTTONA','GRIFFIB','HUMPHRC','KITCHEN','MARRONP','TARPEYT','BALLV') AND ITEGNG = 12)  GROUP BY LHENDT, MQUSER, ITEGNG  ORDER BY 1, 2, 4, 3

the parameter which is
Code:
('BEASLEC','BIRDA','BRAITHM','HARPERS','HILLMI','HODGSOL','HUGHESD','JONESV','LAMBERD','POSTULT','RICKETG','WALSHK','AKTARN','ALOMATL','ATKINSG','AUSTIND','BARSBYH','BARTONB','BENNETM','BEVERLJ','BYRNEJ','CHANDOM','CHANDRS','COLLINA','CUNNIND','DEWERR','DUBREYR','FIELDSA','GODDARB','GOLDINE','GOODWIN','HENSONCL','HILLN','HOGDOK','HUSSIAMA','IYAYIF','JACKT','JANUS','JOHNSOC','LAMBERM','LOVEF','LOVESA','MARRIOC','MARSHAC','MARSHAL','MAYS','METCALW','MISTERJ','NOALLS','PAVIERC','PELLINL','PHIPPST','PURNELD','RAWSONP','RICHARJ','ROBINSC','RUSSELD','SALIMM','SANKEYC','SCOTTL','SCUWANS','SMALLN','SMITHCHA','SWIFTA','TANNAHI','TAYLORM','TOMASEJ','VARLEYJ','WHITEMI','WHITTAN','WILKINS','WILLIAG','WRIGHTE','ZAFFARR','WOODWAC','ADDAMDA','ADDISOS','AKBARR','AMOSM','ANDERSA','ARMSTRE','ARNUEVM','ASGHARSA','AZADM','BAILEYE','BARTLER','BENNETA','BENNETK','BLUNTR','BOYKOM','BRADLEA','BRADLER','BREALEK','BROMBYH','BROWNP','BROWNT','BRUCEL','BURTONA','CAMPBELS','CHANJ','CLARKEJ','COXR','COXV','CUFFEM','DAVIESHE','DELMERS','DIXONS','DOVEC','EDGARD','EVANSRE','FAROOKS','FOUNTAS','GALLAGS','GALLOWR','GOODINR','GRICES','GRIFFIM','HALEEMS','HARRISRA','HARRISSA','HARTJ','HAYDENC','HAYDENG','HAYWOOC','HAYWOOC','HENESH','HICKLIT','HODGESJ','HOPKINR','ILLINGL','ILYASA','INGLETS','INGRAMJ','IRELANE','JACKSOD','JACKSOK','JOHALS','KEANEE','KILKIES','KINGS','KINGSO','KIRKL','KOUSERS','LAIRDS','LALA','LANKESF','LEWISP','LIGHTFC','LIMUMBB','MAJANIR','MALHIR','MAMHOOS','MANNK','MARTINH','MARTINH','MCCULLD','MILLSDA','MORLEYH','MORTIMT','MUHUNDM','NARDONC','NATTRAJ','NEEDHAS','NEWBOLG','NICHOLL','ORGILLS','PAGER','PATELM','PATELR','PICKERN','POINTOV','POWELLA','PRIORC','RAMSDAR','RAZAKA','RAZAQUN','REDPATK','RUPRAR','SANDHUD','SANDHUS','SAOULIN','SAOULIN','SHAHZAN','SHARMAA','SHARMAK','SINGHV','SMITHCHRI','SMITHN','SMITHSE','SOANESR','STAFFOM','STATHAAL','STEVENG','SUMMERC','SURGEYS','SWANM','TATTERA','TOMLINK','TOMLINL','WAITESK','WALTERD','WHITEK','WILLIAC','WINFIEC','WOODERC','WRIGHTT','YAQOOBP','ALBONA','BOORMAA','BROWNY','CLARKES','CLARKJA','DAVENPM','HARSEIM','KARIMY','SEATONV','WELSHA','WHITEM','WILSONMI','AMOSN','ARMESA','ASTLEM','AUSTINE','BENNETAN','BULLG','BURNSN','BURTOND','BYRNEP','CARTERMI','CHARLEC','CHOCHOA','CHOCHOS','CHRISTNI','CLARKET','EVERETR','FENNELM','GEET','GODFREV','GOODBAS','HALLAMB','HALLAMM','HARVEYL','HOWELLE','HURHANP','HUSSAISHA','JACKSOLE','KEYWOOC','LEWISMA','MAPPR','MCCLUSM','MCKECHH','MILEST','MILLARH','MILLSV','MUNIRM','ONEILLF','PERRINS','PILSWOB','PRESLAH','RICHARDY','SANDLED','SIMAKG','SMALLH','SMITHL','STAPLER','THOMPSDE','TOPLEYJ','WALLISJ','WALSHC','WELLIND','WILSONHO','WILSONKE','ZAHOORN','ADONISA','ASHMORN','AYUBA','BABERA','BALJ','BARKERAD','BASHKUB','BENNICL','BIRKR','BRIDGEE','BRITOND','BROWNL','BUTLERK','BUTTS','BYFIELD','CAMPBEV','CAUDWES','CHOUDHN','CHOUDHNA','CLUTTET','COXC','DAVIESC','DEANA','DEERS','DEMPSEA','DESAIJ','DHUPHAR','EATONR','EBANKSC','EMERSOJ','ERIBAKT','EVANSLO','EYOA','FAIRMAP','HALAMP','HALLF','HANIFM','HARINAD','HARRISSH','HAYERG','HAZIMEG','HITCHL','HOOLEYJ','HUDSONN','HUSKINS','HUSSAINM','JACKSODE','JACKSON','JEGEDET','JOBEF','JOHNSOP','KHANA','KHANR','KINSEYM','LAWLORN','LEMPARM','LIUJ','MADDEND','MAKATIN','MARRIOJ','MAYFIEN','MCARDLC','MCCRERL','MIDDLEJ','NADIAS','NEALK','NIXONS','NORRYG','PADDAMA','PALMERT','PARKERLE','PHILIPJ','RAFIQG','RAHMANZ','REDMONC','ROSEC','ROUSEA','SACHDES','SACKLEA','SHAKEEM','SHARMATA','SHEPERM','SLATERM','SMYTHC','STURNUK','THOMPSN','TOLMIEL','TUTIND','VADEHRD','WARRENJ','WATSONN','WEBBC','WEIGHTJ','WIGGINS','WILCOXB','WORTHYS','ZALPURM','BEAVISR','BEIRNEA','CHARLEK','HACKINJ','HANDLEJ','HUDSONMA','JARVISC','RAFIQK','SANKEYRU','SIMJ','THOMSOJ','WEBERM','WRIGHTA','BERNARB','BREALEJ','BROOKSI','BROWND','CHOUDHNAH','CULLENJSM','DRINKWJ','ENGLISN','FOSSN','GRANTA','HEALC','HODGESG','HUGHESGSM','NAWAZB','NUTTALE','PITTERR','REDMONL','RIEDK','ROBERTM','SCOTTC','SMITHPE','WILSONJ','AHMEDSH','ALIS','ALISH','ALLENM','BEGUMN','BESTA','BLAKEE','BOOTA','BRITTONM','BROWNJO','BUTLERS','CARES','CAUNTE','DAVIESJ','DAVISOHO','DUNCANB','FLYNNRE','FORSOND','GOODIEP','HAMMONL','HANNISL','HARRISK','HECTORK','HORNERD','HOWELLJ','HUCKLEJ','INKSTER','JOHNSTS','KHANASI','KHANL','LARAGYG','LONGHK','MAHMOOWA','MARSHAT','MARTINA','MEEM','MOHAMMS','MOOREST','MORTONP','MURRAYL','NEWSTEA','PARKERV','PULFORL','RASIBM','SELBYH','SINGHH','SISSONE','SMITHE','SOWEMIW','STRAWL','TURNERK','WAPLINM','WARDLY','WATSOND','WIDDOWH','WILLISW','AMOSS','BEARDH','BURGING','BURTONT','DUTTONA','GRIFFIB','HUMPHRC','KITCHEN','MARRONP','TARPEYT','BALLV')
i would like in a text file for example for easy changing.
Is this possible?

Regards

Metalboy

“It is a mistake to think you can solve any major problems just with potatoes.”
Douglas Adams
 
Create a parameter table with a user column you join on HDPULSE4DX.MQUSER

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top