|
Yes. There are two ways, both of which can involve some annoying fiddling with apostrophes: 1.) Use rtvqmqry to extract SQL source from the query to a source member and substitute a variable for the parameter or the entire where clause or whatever part is most convenient for you. Use the crtqmqry command to create the query. Use strqmqry to run the query. You'll need to pass the parms as setvars in the strqmqry command. 2.) Dependent variables in a query It's documented in a weird way in the Query manual. You'll need to run the query as a query management query alwqrydfn *yes with the parm(s) as setvar parms in the command. Here's what the manual says about the dependent variables: 2.5.3 Selecting Records for an OfficeVision Dependent Column List A dependent query is used in data/text merge to relate the column list part to the multicopy part in an OfficeVision form letter. Such a query can only be used for this one specialized purpose; you cannot display or print a report using a dependent query. In "An Example of a Dependent Column List Merge" in topic 2.5.3.1, a dependent query is used to print a form letter to customers listing their purchases for the year. The special part of a dependent query is its Select Records display. One or more of the values on the display has a colon before the field name, such as this: CUSNAME EQ :NAME The colon indicates that the query is a dependent query. It also indicates that the field called NAME, the dependent value, is in a different query or file (this makes the query dependent on the other query or file). Pressing the Enter key on the Select Records display when it has such a colon shows the Specify Dependent Value Qualifiers display. On this display, you indicate the name of the file or query that contains the dependent value, the library in which the file or query is stored, and, when the dependent value is in a file, the member name. See the book, Using OfficeVision/400 Word Processing for additional information about how to create multiple copies of a document and how to use column list merge. -----Original Message----- From: JGracetri@aol.com [mailto:JGracetri@aol.com] Sent: Thursday, June 29, 2000 6:31 AM To: MIDRANGE-L@midrange.com Subject: pass parms to qry400 Does anyone know if you can do the following. cl pgm dcl &item dclf screen rcvf screen runqry xxxxx parm &item end pgm I do not want the user to have access to the select on qry itself. thank you jeff G. +--- | This is the Midrange System Mailing List! | To submit a new message, send your mail to MIDRANGE-L@midrange.com. | To subscribe to this list send email to MIDRANGE-L-SUB@midrange.com. | To unsubscribe from this list send email to MIDRANGE-L-UNSUB@midrange.com. | Questions should be directed to the list owner/operator: david@midrange.com +---
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.