× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Francis,
If you are using the STRQRY product to run your queries, you can not pass any variables.
If you do not have the full SQL product, you can still run the STRQMQRY by placing your SELECT statement in a source member and then creating the QMQRY with the CRTQMQRY command.
In your source member, code the variables for your SELECT with an Ambersand (&) in front of the variable name.
Since you are going to be using character variables, see the earlier theread here today regarding passing character variables to STRQMQRY.


Jeff Young
Sr. Programmer Analyst
IBM -e(logo) server Certified Systems Exper - iSeries Technical Solutions V5R2
IBM Certified Specialist- e(logo) server i5Series Technical Solutions Designer V5R3
IBM Certified Specialist- e(logo)server i5Series Technical Solutions Implementer V5R3









----- Original Message ----
From: Frances Denoncourt <Frances.Denoncourt@xxxxxxxxxxxxxx>
To: Midrange Systems Technical Discussion <midrange-l@xxxxxxxxxxxx>
Sent: Friday, December 21, 2007 3:01:31 PM
Subject: Re: QMQRY use LIKE?

Thanks...but, I do the F1 before getting too carried away.

I use LIKE often and am familiar with the % before and after. It's passing parms that I'm not up to speed and really shouldn't spend a lot of time on because I'm supposed to be working on dotnet stuff and not supplying users with some tool they really ought to have. I try to get these Q&D done on my own time. So, now, do I get in trouble (again) for doing a quick query for "my" user...or???

The reason I asked about LIKE was because I did try the LIKE as in:
OR RPREFA EQ :inpos
OR RPPRCL LIKE :inparcel

and got this message "Value not correct, cursor at position to check for error."
The cursor is positioned at the colon.

I had figured from previous msgs that I could load the string with the % where needed, but I cannot get that far.

Tried the RTVQMQRY command and sure enough got the WHERE clause everyone was talking about.
I'm familiar with it in SQLServer 2005. Now, to figure out what to do with it here.

I just mentioned about full blown SQL in case someone suggested that route for something as in previous posts. Now, I see where they are coming from.


I've been in that manual a few times - didn't find what I needed. Kind of like looking in the dictionary on how to spell a word if you are way off base to begin with. But, this might help.

Yes, I agree that there are limitations with QRYDFN.

Thanks for all of your help.

Fran Denoncourt
Sr. Programmer/Analyst
Pinal County Treasurer's Office
Florence, AZ 85232
(520) 866-6404

Receipt of this message does not grant you permission to send me
Unsolicited Commercial Email


Vernon Hamberg <vhamberg@xxxxxxxxxxx> 12/21/2007 10:55 AM >>>

Fran

Others have pointed out the LIKE operator in the record selection
screen - documentation is as close as your F1 key when your cursor is
in that column or the value column.

You might not be aware that you don't need the full blown SQL to use
QMQRY even better - forms, now, they can be ugly - heh.

Query management support is part of the OS - comes with every machine.

You can RTVQMQRY from a QRYDFN - main problems come when using other
than a type 1 join. This gives you a source member, that you use to
CRTQMQRY. There is even a WRKQMQRY with several handy options.

Using RTVQMQRY with dependent values, as you have, will result in the
&INPOS as part of the SQL statement in question. I can't urge
strongly enough that eventually you create your own source members
with your SELECT statement in them - or any valid SQL statement, for
that matter. And use CRTQMQRY.

NOTE: The source file, usually named QQMQRYSRC, has to have a
RCDLEN(91) - not 92.

You have much more power using actual SQL on QMQRY source - QRYDFNs
can be handy but have some limitations, or at least difficulties,
when using ANDs and ORs - no parenthesizing possible.

There's a manual called Query Management Programming that has a lot
of this information - and more than you probably WANT to know! You
can find it under the Database topic at InfoCenter.

HTH
Vern

At 10:59 AM 12/21/2007, you wrote:

We are at V5R2M0 and do not have the full blown SQL.

I use the limited RunSQLStm with a script in a database file,
though. However, this is not my issue at the moment.

I use WRKQRY to generate queries and in this case can build a query
to receive parms from a CL as in my prior posts.

My select records screen looks like this:
RPREFA EQ :inneg
OR RPREFA EQ :inpos
OR RPPRCL EQ :inparcel


I'd like to add a LIKE statement, too. Is that possible? If so,
could you point me to some documentation?
Thanks again,


Fran Denoncourt
Sr. Programmer/Analyst
Pinal County Treasurer's Office
Florence, AZ 85232
(520) 866-6404


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

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.