|
Hello Vernon, You wrote: >This is just normal QMQRY behavior - substitution variables that are >strings need the apostrophes around them. Every setvar value is a >character string. Those would probably want double apostrophes, to get >the apostrophe into the result. I think you misunderstand. The message I showed was the result of coding: CUSNAM LIKE :name in the Query/400 definition. The same error occurs if you code any of: CUSNAM NLIKE :name CUSNAM LIST :var1 :var2 :var3 CUSNAM NLIST :var1 :var2 :var3 The point is that Query/400 does not let you define variables for LIKE, NLIKE, LIST, or NLIST therefore you cannot create the initial query and that seems a silly restriction which is why I suggested a DCR (even though variables for those functions would be awkward to support). I seriously doubt that: CUSNAM LIKE ':name' will result in the desired behaviour (but I haven't tried it). If the initial query cannot be created in Query/400 then the only alternative is to create a QMQRY from scatch. I thought it would be obvious that a QMQRY could handle the requirement and so did not say that. However, most (many) people seem frightened of QMQRY because they must know SQL and thus they would rather use Query/400 to create the initial query unless they own the SQL Development Toolkit and can use the Query Manager prompted interface. To compensate for my oversight, here is the bleeding obvious: o Open a source member using SEU (or your editor of choice) o Type the following (changing the names as required) SELECT * FROM the-file WHERE the-field LIKE &LIKE o Save and exit o Turn the source into a QMQRY using the CRTQMQRY command o Run the query (changing the names as required) STRQMQRY the-query SETVAR((LIKE '''search-value''')) Regards, Simon Coulter. -------------------------------------------------------------------- FlyByNight Software AS/400 Technical Specialists http://www.flybynight.com.au/ Phone: +61 3 9419 0175 Mobile: +61 0411 091 400 /"\ Fax: +61 3 9419 0175 mailto: shc@flybynight.com.au \ / X ASCII Ribbon campaign against HTML E-Mail / \ --------------------------------------------------------------------
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 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.