🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: comp.lang.pascal.delphi.databases
2 messages
2 total messages Started by Martin Cativa Gronda Sat, 02 Nov 1996 00:00
How to Find a Substring into a .DBF field with Local SQL
#224
Author: Martin Cativa Gronda
Date: Sat, 02 Nov 1996 00:00
23 lines
1558 bytes
Hi All!

I need to search a substring into a field inside a .DBF file,
using Local SQL.
I have a .DBF with a 2 fields, ZipCode (longint) and StateName
(String[40]), I want to make a search for a sigle word inside the
Statename, How can I do that with SQL statemens?

For example find the record "NEW YORK" when I enter "YORK" as substring.

I tried SELECT * FROM "BASE.DBF" WHERE Statename=:VAR1

beeng VAR1 the substring, but off course that only searchs an exact
value,
I read that Local SQL supports SUBSTRING(), but I don't how to use it.

Thanks for your help  
---
                  Martin Cativa Gronda
     )|(          E-mail: moonred@satlink.com                   
    (o o)         Cordoba - ARGENTINA  
-ooO-(_)-Ooo-------------------------------------
Re: How to Find a Substring into a .DBF field with Local SQL
#225
Author: Manuel Cuevas
Date: Tue, 10 Dec 1996 00:00
30 lines
1300 bytes
Hi, Martin !

Martin Cativa Gronda <moonred@satlink.com> wrote:

>For example find the record "NEW YORK" when I enter "YORK" as substring.

>I tried SELECT * FROM "BASE.DBF" WHERE Statename=:VAR1

Try

      	SELECT * FROM "BASE.DBF" 
	WHERE StateName LIKE ( '%'+:VAR1+'%' )

Regards,

                                               Manuel Cuevas
                                  wwwmaster@mbytesl.com

        Manuel Cuevas

    wwwmaster@mbytesl.com
    http://www.mbytesl.com

  100115.314@compuserve.com

   CIS        : 100115,314
   Fidonet    : 2:345/606
   Virnet     : 9:341/302
   ClipperNet : 225:345/601
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads