MIDRANGE dot COM Mailing List Archive



Home » MIDRANGE-L » May 2002

RE: Passing parms to query



fixed

There's no reason this could NOT be done, if, say, you wanted to vary the
relational operator. Just be sure to put only single apostrophes around it.
Substitution variables will put whatever you want into the statement.

Oh, BTW, be careful with strings - you'll need to work out the double
apostrophe thing. And if you run it without setting the SETVARs, it'll
prompt you - do NOT put in the extra apostrophes.

Confused yet?  :-)

At 01:21 PM 5/9/02 -0700, you wrote:
>You should not be doing the compare with the setvar. It should only be
>passing a var. test that var in the qry. In the qry use the select record
>section to test the var   field ge :lodate
>
>
>
>__________________________________________________
>Kirk Goins
>IBM Certified iSeries Technical Solutions Expert
>Pacific Information Systems - An IBM Premier Business Partner
>503-674-2985           kirkg@pacinfosys.com
>
>
>-----Original Message-----
>From: Dan Rasch [mailto:drasch@mail.win.org]
>Sent: Thursday, May 09, 2002 12:44 PM
>To: midrange-l@midrange.com
>Subject: Passing parms to query
>
>
>
>I followed up on the thread earlier of passing parms to a query,
>and the results were good.
>
>The query command I assembled was this (almost an exact copy from the
>FAQ site):
>
>STRQMQRY QMQRY(TDER3/PASSPARM) QMFORM(*QMQRY)
>ALWQRYDFN(*YES)
>SETVAR((LODATE 1011001))
>
>beautiful, but I tried it with SETVAR((LODATE *GE 1010101))
>and I get the error:
>
>Too many values in list for parameter SETVAR.
>
>I looked STRQMQRY up in the manuals (remember them) from V3R2
>and it used the example of VAR1 and VAR2 being SQL statements,
>but gave no indication of where these two variables belonged in
>the QUERY definition.
>
>The harder I think, the confuser I get.
>
>
>Dan Rasch - because if the human species concentrated on the really
>important things in life, there would be a shortage of fishing poles!
>IBM Certified twice....... but still a couple PTFs away from Nirvana.
>
>_______________________________________________
>This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
>To post a message email: MIDRANGE-L@midrange.com
>To subscribe, unsubscribe, or change list options,
>visit: http://lists.midrange.com/cgi-bin/listinfo/midrange-l
>or email: MIDRANGE-L-request@midrange.com
>Before posting, please take a moment to review the archives
>at http://archive.midrange.com/midrange-l.
>
>_______________________________________________
>This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
>To post a message email: MIDRANGE-L@midrange.com
>To subscribe, unsubscribe, or change list options,
>visit: http://lists.midrange.com/cgi-bin/listinfo/midrange-l
>or email: MIDRANGE-L-request@midrange.com
>Before posting, please take a moment to review the archives
>at http://archive.midrange.com/midrange-l.







Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2014 by MIDRANGE dot 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 here. If you have questions about this, please contact