|
-- [ Picked text/plain from multipart/alternative ] Mike, In a message dated 3/28/02 1:29:13 PM US Eastern Standard Time, Mike_Smith@RGCResources.com writes: > I have an existing sql statement that looks like this. > > SELECT count(*) FROM UPRM WHERE UPSTP IN(0,9999) and UPSST NOT LIKE > '#%' AND UPTYP NOT IN ('HG', 'PC', 'PE', 'PF', 'PH', 'PI','PO', > 'PR', 'PS', 'PX') AND UPSTS NOT IN('CD', 'RT', 'SS') > > I have been asked to take all the selection criteria and put it in a > control > file so that if the selection values change I don't have to change the > query. <<snip>> Sorry to take so long to get back, but I was on vacation last week. What you need to do is to retrieve your selection into a string variable (no longer than 256 bytes), say SQLSTR, and then perform something like this (don't have the system available right now to test it for sure). DECLARE CMAIN CURSOR FOR SMAIN PREPARE SMAIN FROM :SQLSTR OPEN CMAIN Then the usual FETCHes and checking for SQLSTS... HTH, Dean Asmussen Enterprise Systems Consulting, Inc. Fuquay-Varina, NC USA E-mail: DAsmussen@aol.com "The early bird may get the worm, but the second mouse gets the cheese..." -- Anonymous
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.