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



I've used

SELECT COUNT(*) INTO :#RecsFound
FROM SRCMBR
 WHERE POSSTR(SrcDta, RTRIM(:cVarString1)) <> 0

where cVarString1 was the string that I was looking for.

----Original Message Follows----
From: EDoxtator <doc6502@xxxxxxxxx>
Reply-To: RPG programming on the AS400 / iSeries <rpg400-l@xxxxxxxxxxxx>
To: rpg400-l@xxxxxxxxxxxx
Subject: Alternatives to LIKE in SQL
Date: Wed, 4 Aug 2004 09:40:17 -0700 (PDT)

Hey All

I'm going to be doing some mass-scans of RPGLE source, and I'm trying to figure
out if there's a better way than using the SQL LIKE keyword.


I was thinking I'd to do Dynamic SQL that looks something like this:


SELECT COUNT(*) FROM SRCMBR WHERE SRCDTA LIKE '%<field name>%' AND SUBSTR(srcdta,7,1) <> '*'

This select does two character comparasons, which can't be cheap, and the LIKE
has to do a pattern match which is likewise expensive. However, I don't know
enough about SQL to do anything that would be less intensive.


This is part of a set of programs that will enable me to keep track of various
versions of our product at certain customer sites. For that reason, I want
this solution to be as automated as possible (otherwise, I'd wumpus up some
quick and dirty programs driven through a PDM option).


Any ideas?

Thanks

-Doc

--
This is the RPG programming on the AS400 / iSeries (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.

_________________________________________________________________
FREE pop-up blocking with the new MSN Toolbar ? get it now! http://toolbar.msn.click-url.com/go/onm00200415ave/direct/01/



As an Amazon Associate we earn from qualifying purchases.

This thread ...


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.