Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Stefan Wuebbe
  Where is Stefan Wuebbe?
 Hamburg
 Germany
 Stefan Wuebbe
 To: Keith Patterson
  Where is Keith Patterson?
 Roanoke
 Virginia - United States
 Keith Patterson
 Tags
Subject: RE: Query question
Thread ID: 228555 Message ID: 228562 # Views: 1 # Ratings: 0
Version: Visual FoxPro 6 Category: Databases, Tables and SQL Server
Date: Tuesday, May 19, 2009 10:06:03 PM         
   


> I am running this query
>
> select p_reason from hrpersnl where p_reason = 'PRN'
>
> and it is returning rows where p_reason = 'PRN', but it is also returning rows where p_reason = 'PRN2PT' and rows where p_reason = 'PRN2FT'.
>
> This is a FoxPro table (ABRA) and I'm not terribly familiar with Foxpro syntax, but I've not seen anything act like this before.
>
> Any ideas why I'm experiencing these strange query results?
>

In addition to Boris' == suggestion, you can also Set Ansi On:

CREATE CURSOR hrpersnl (p_reason Char(20))
INDEX on p_reason TAG p_reason COLLATE 'machine'
SYS(3054,11) && show Rushmore optimization level
INSERT INTO hrpersnl VALUES ('PRN')
INSERT INTO hrpersnl VALUES ('PRN2PT')
SET ANSI OFF && default
SELECT p_reason FROM hrpersnl WHERE p_reason = 'PRN' && 2 rows
SET ANSI ON
SELECT p_reason FROM hrpersnl WHERE p_reason = 'PRN' && 1 row
SET ANSI OFF
SELECT p_reason FROM hrpersnl WHERE p_reason == 'PRN' && 1 row



hth
-Stefan

ENTIRE THREAD

Query question Posted by Keith Patterson @ 5/19/2009 9:33:41 PM
RE: Query question Posted by Borislav Borissov @ 5/19/2009 9:41:49 PM
RE: Query question Posted by gerrit broekhuis @ 5/19/2009 9:44:27 PM
RE: Query question Posted by Borislav Borissov @ 5/19/2009 9:54:37 PM
RE: Query question Posted by Stefan Wuebbe @ 5/19/2009 10:06:03 PM
RE: Query question Posted by Andy Kramek @ 5/19/2009 10:51:10 PM
RE: Query question Posted by Keith Patterson @ 5/21/2009 6:45:01 PM
RE: Query question Posted by Anders Altberg @ 5/20/2009 12:10:37 AM