Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Cetin Basoz
  Where is Cetin Basoz?
 Izmir
 Turkey
 Cetin Basoz
 To: suhas hegde
  Where is suhas hegde?
 sirsi
 India
 suhas hegde
 Tags
Subject: RE: Help with SQL statement
Thread ID: 154422 Message ID: 154761 # Views: 2 # Ratings: 0
Version: Visual FoxPro 9 Category: Databases, Tables and SQL Server
Date: Wednesday, December 19, 2007 12:30:56 PM         
   


> >
> > IOW with SQL series commands:
> >
> >
FirstName == "suhas"
> > FirstName == "suhas               "
> > "suhas" == FirstName
> > "suhas"+space(10) == FirstName+space(20)

> > all yield the same result meaning firstName is exactly "suhas" (trailing spaces are ignored no matter how many). Thus:
> >
> >
Field == ""

> >
> > always means empty(Field) in SQL (char field) no matter what the current EXACT or ANSI is - EXACT has no effect anyway.
>
> that is what i am trying to say
>
> Please take a look at this
>
>
> create cursor foo (f1 c(10))
> append blank
> replace f1 with chr(13)
> 
> select * from foo where f1 == ""
> ?_tally
> select * from foo where empty(f1)
> ?_tally
> 


Ah,
You're cheating:) Yes, characters 9,10,13 besides 32 return .t. for empty. SQL == counts only chr(32) as empty.
Then question arises, should I accept a field that has 9,10 or 13 in it as empty or not. That would depend (especially with memo it confuses to see the field as 'empty()=.t.' with 9,10,13 in it when a browse shows 'Memo').
In general, == "" works right, because users in theory would have an hard time to enter 9,10,13 in a field:) You're right of course thinking all the possibilities - then maybe one still could speed it up with an expression like: ( field == "" or empty(field) ). I don't know, never tried:)

Cetin Basoz

ENTIRE THREAD

Help with SQL statement Posted by Mike Gagnon @ 12/15/2007 1:30:11 PM
RE: Help with SQL statement Posted by Borislav Borissov @ 12/15/2007 2:54:07 PM
RE: Help with SQL statement Posted by Mike Gagnon @ 12/15/2007 3:05:27 PM
RE: Help with SQL statement Posted by Borislav Borissov @ 12/15/2007 3:20:50 PM
RE: Help with SQL statement Posted by Bernard Bout @ 12/15/2007 3:20:21 PM
RE: Help with SQL statement Posted by Mike Gagnon @ 12/15/2007 3:56:26 PM
RE: Help with SQL statement Posted by suhas hegde @ 12/16/2007 4:43:13 PM
RE: Help with SQL statement Posted by Tamar Granor @ 12/17/2007 10:24:26 PM
RE: Help with SQL statement Posted by Mike Gagnon @ 12/17/2007 11:23:35 PM
RE: Help with SQL statement Posted by Cetin Basoz @ 12/18/2007 1:14:39 PM
RE: Help with SQL statement Posted by suhas hegde @ 12/18/2007 2:48:28 PM
RE: Help with SQL statement Posted by Cetin Basoz @ 12/18/2007 9:06:34 PM
RE: Help with SQL statement Posted by suhas hegde @ 12/19/2007 4:03:39 AM
RE: Help with SQL statement Posted by Cetin Basoz @ 12/19/2007 12:30:56 PM
RE: Help with SQL statement Posted by suhas hegde @ 12/19/2007 12:53:16 PM
RE: Help with SQL statement Posted by Cetin Basoz @ 12/19/2007 1:22:51 PM
RE: Help with SQL statement Posted by suhas hegde @ 12/19/2007 3:55:12 PM
RE: Help with SQL statement Posted by Mike Gagnon @ 12/18/2007 4:04:56 PM