Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Jun Tangunan
  Where is Jun Tangunan?
 Cabanatuan
 Philippines
 Jun Tangunan
 To: Mike Yearwood
  Where is Mike Yearwood?
 Toronto
 Canada
 Mike Yearwood
 Tags
Subject: RE: NOFILTER?
Thread ID: 310763 Message ID: 310998 # Views: 32 # Ratings: 0
Version: Visual FoxPro 9 SP2 Category: General VFP Topics
Date: Tuesday, June 28, 2011 1:31:56 AM         
   


> >
> >
> > I beg to differ. Time is and will be wasted trying to decide "whether to place it or not" on an SQL SELECT clause. Why? Because he is not sure "when" that clause is necessary or not.
> >
> > Time won't be wasted on trying to "learn" when it is needed or not. Any additional knowledge gained is not a waste. Once a developer already knew "when" it is needed, then there won't be any deciding left to waste.
> >
> > It is my personal preference not to clutter my SQL SELECT with unnecessary NOFILTER clause like this:
> >
> >
SELECT t1.fld1, t2.fld2 from table1 t1;
> >   Left Outer Join table2 t2;
> >   ON t1.this = t2.that;
> >   INTO CURSOR Junk ;
> >   READWRITE
> > 

> >
> > a. Whether NOFILTER (and READWRITE) is there or not, that SQL SELECT will result to a true cursor. So why put NOFILTER?
> > b. Since READWRITE is already there, then NOFILTER is no longer needed. Again, why put the NOFILTER clause?
> >
> > I believe it is always better to know the underlying reasons why we use a clause or not. It is always better than blindly moving along. Although, I agree with you there is absolutely no harm in placing NOFILTER clause on every SQL SELECT statements; even with the one above:
> >
> >
SELECT t1.fld1, t2.fld2 from table1 t1;
> >   Left Outer Join table2 t2;
> >   ON t1.this = t2.that;
> >   INTO CURSOR Junk ;
> >   NOFILTER ;     && Not necessary but does not do any harm
> >   READWRITE
> > 

> >
> > http://sandstorm36.blogspot.com/
> > http://weblogs.foxite.com/sandstorm36/default.aspx
> > http://www.coderisland.com/forum/viewforum.php?f=10
>
> Think of NOFILTER as a comment and a guarantee that you never get a FILTER instead of a cursor. Reducing all risks leads to more stability and less bugs.
>
> Mike Yearwood
> Microsoft MVP Visual FoxPro 2008, 2009
> We have enough youth. We need a fountain of smart!
> There may be many ways to skin a cat, but there are very few right ways to do it.


LOL! Actually I agree with you that NOFILTER is really required. I cannot think of a single case in my end where I need just a filtered result. It is just my personal preference not to see that clause in all SQL SELECTs. Same goes with mdot, it is my preference not to see it on the left side of the equation.

But you are quite right, it is simpler to put that clause on all SQL SELECTs because there is no harm I can see in doing so, while unintentionally omitting it may result to certain problems. Although in most SQL SELECTs, a NOFILTER is invisibly added anyway by VFP, adding it on every SQL SELECT makes things easier and faster during coding time.


http://sandstorm36.blogspot.com/
http://weblogs.foxite.com/sandstorm36/default.aspx
http://www.coderisland.com/forum/viewforum.php?f=10

ENTIRE THREAD

NOFILTER? Posted by Russell Hill @ 6/24/2011 7:57:00 AM
RE: NOFILTER? Posted by Borislav Borissov @ 6/24/2011 8:18:00 AM
RE: NOFILTER? Posted by Russell Hill @ 6/24/2011 8:29:57 AM
RE: NOFILTER? Posted by Borislav Borissov @ 6/24/2011 8:37:07 AM
RE: NOFILTER? Posted by Russell Hill @ 6/24/2011 11:33:38 AM
RE: NOFILTER? Posted by Stefan Wuebbe @ 6/24/2011 12:26:54 PM
RE: NOFILTER? Posted by Russell Hill @ 6/26/2011 12:36:06 AM
RE: NOFILTER? Posted by Mike Yearwood @ 6/25/2011 7:02:04 PM
RE: NOFILTER? Posted by Tamar Granor @ 6/25/2011 7:18:27 PM
RE: NOFILTER? Posted by Mike Yearwood @ 6/25/2011 7:45:47 PM
RE: NOFILTER? Posted by Tom Saddul @ 6/27/2011 5:49:34 AM
RE: NOFILTER? Posted by Samir H. @ 6/27/2011 6:05:59 AM
RE: NOFILTER? Posted by Tom Saddul @ 6/27/2011 1:19:56 PM
RE: NOFILTER? Posted by Russell Hill @ 6/26/2011 12:38:34 AM
RE: NOFILTER? Posted by Tom Saddul @ 6/26/2011 3:40:20 AM
RE: NOFILTER? Posted by Russell Hill @ 6/26/2011 1:46:36 PM
RE: NOFILTER? Posted by Samir H. @ 6/26/2011 2:35:17 PM
RE: NOFILTER? Posted by Russell Hill @ 6/26/2011 11:10:49 PM
RE: NOFILTER? Posted by Jun Tangunan @ 6/27/2011 2:23:20 AM
RE: NOFILTER? Posted by Mike Yearwood @ 6/27/2011 4:06:05 AM
RE: NOFILTER? Posted by Jun Tangunan @ 6/27/2011 5:24:15 AM
RE: NOFILTER? Posted by Mike Yearwood @ 6/27/2011 9:49:47 PM
RE: NOFILTER? Posted by Mike Yearwood @ 6/27/2011 9:53:19 PM
RE: NOFILTER? Posted by Jun Tangunan @ 6/28/2011 1:31:56 AM
RE: NOFILTER? Posted by Mike Yearwood @ 6/28/2011 2:17:07 AM
RE: NOFILTER? Posted by Jun Tangunan @ 6/28/2011 2:57:26 AM
RE: NOFILTER? Posted by Mike Yearwood @ 6/28/2011 3:43:17 PM