× 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.



The first I would check is the other 2 fields on your where clause. Are
they excluding your record?



From:
Jerry Adams <Jerry@xxxxxxxxxxxxxxx>
To:
RPG programming on the IBM i / System i <rpg400-l@xxxxxxxxxxxx>
Date:
12/29/2009 02:13 PM
Subject:
RE: Like in embedded SQL
Sent by:
<rpg400-l-bounces@xxxxxxxxxxxx>



You need to code if as LIKE '%200%'. Without the closing % it only
matches on those locations that end in 200.

On the other hand, you may not want, for example, A200L, which this would
select.

Jerry C. Adams
IBM System i Programmer/Analyst
--
B&W Wholesale
office: 615-995-7024
email: jerry@xxxxxxxxxxxxxxx


-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx]
On Behalf Of THarteau@xxxxxxxxxxxxxxxxxx
Sent: Tuesday, December 29, 2009 1:39 PM
To: RPG programming on the IBM i / System i
Subject: Like in embedded SQL

Hi,
Are there any issues when using LIKE in an SQL declare statement?
I have the following line:
/EXEC SQL
+ DECLARE C6 CURSOR FOR SELECT LPROD, LWHS, LLOT, LLOC, LOPB, LISSU,
+ LADJU, LRCT, LIALOC, LISTAT, WLSTS FROM ILIL01 JOIN ILM ON WWHS =
+ LWHS AND WLOC = LLOC WHERE LWHS = :KEYWHS AND LPROD = :PROD AND L
+ LOC LIKE '%200' ORDER BY WLSTS, LLOC FOR FETCH ONLY
/END-EXEC

It seems to work when it finds 11A200 or 22A200, but it is not returning
2A200. Any ideas? Thanks!

<===================================================>

Terri Harteau
Felker Brothers Corporation
****************
"Do not follow where the path may lead. Go instead where there is no path
and leave a trail."
Ralph Waldo Emerson

****************




As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

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.