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



Thanks, Birgitta... I hadn't tried a varying field.  It's good to know that
it works the way one would expect.

It's also nice to know that you can use TRIM on a host variable.  It would
be nice if you could then concatenate that trimmed variables with a '%'
right in the SQL statement.

Joe

From: HauserBirgitta

Hi,

there are several possibilites to solve your problem:

Here are some examples:
D HstName         S             50A   varying
D HstNameFix      S             50A
 *------------------------------------------------------
C                   Eval      HstNameFix = '%Media%'

C/Exec SQL
C+ Delete from MyTable
C+            Where  Name Like Trim(:HstNameFix)
C/End-Exec

C                   Eval      HstName = '%Meier%'

C/Exec SQL
C+ Delete From MyTable
C+            Where Name Like :HstName
C/End-Exec

C                   Eval      HstName = 'Miller'

C/Exec SQL
C+ Delete From MyTable
C+            Where PosStr(Name, :HstName) > 0
C/END-EXEC

C                   Eval      HstNameFix = 'Brown'

C/Exec SQL
C+ Delete From MyTable
C+            Where PosStr(Name, Trim(:HstNameFix)) > 0
C/END-EXEC

Hope this helps.

Mit freunlichen Gruessen / Best regards

Birgitta Hauser



Is this the correct way to write an embedded sql "DELETE FROM" statement
with a wildcard?
==============================================================
          C/EXEC SQL
          C+ delete from qtemp/tempf1 where ACITY not like :BCITY || '%'
          C/END-EXEC
==============================================================

Thanks,

Frank



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
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.