|
Alan Campin wrote:
I want to do the following. Am I going to have to create a
dynamic SQL statement?
Exec Sql Declare C1 Cursor For
Select MLNAME,
MLMTXT,
MLSEU2
From QTEMP/MBRLIST
Where MLNAME Like :Pattern
Order By MLNAME;
Pattern has something like '%LL%'
I have tried as above and
'''%LL%'''
They all return no records.
Typically for MLNAME being CHAR(10), the correct pattern should be
'%LL%%%%%%%' where the extra percent signs ensure the pattern match is
not interpreted as '%LL% ' which is, instead of what is desired, a
request to find all rows that have 'LL' within the first four bytes of
the string [because the last six must of course be spaces]. The noted
as correct pattern will search for any rows that have 'LL' anywhere in
the string. IIRC if MLNAME is VARCHAR [original type or cast in the
WHERE clause], the original described pattern will function as expected.
FWiW there may also be a QAQQINI option which makes the host variable
be interpreted as variable; or perhaps I am confusing with some other
memory of host variables and the INI.?
Regards, Chuck
--
This is the RPG programming on the IBM i / System i (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.
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.