Re: SQL query problem with character comparison.
- From: "Anders Altberg" <anders.altberg>
- Date: Tue, 20 Mar 2007 10:06:47 -0700
Remove AND NOT DELETED(). It does not work like you think.
SET DELETED ON before the query (and keep it on always.)
FoxPro SQL queries are not governed by the setting of SET EXACT. They are
governed by SET ANSI.
Did FPW2.6 not have == for exact comparisons?
-Anders
"Leena" <Leena.reach@xxxxxxxxx> wrote in message
news:1174392242.914798.265580@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hi,
I have a problem in Foxpro. We have a query like
Select * from Account, Bank where alltrim(account.bank_id) =
alltrim(bank_bank_id) and alltrim(account.Bac) = alltrim(Bank.Bac) and
alltrim(Bank.Bac) = '0000991' and not Deleted()
Bank table has a column Bac which is type Charater(7). The application
always inserts 7 charactes in this column. Eg. for 71 it will insert
0000071. But i have some records in the table which are marked deleted
and they have bac column as 0001 i.e is less than 7 characters.
The problem is above query does not return a result set even though
there are records present.
Moreover if i pack the table Bac, the query works fine.
I also tried changing the query to Bank.Bac = '0000144'. Initially it
worked fine and returned me 400 records. Then i zapped 300 records
from account and executed the query. this time it agan gave me no
records. By some trial and error i found that the modified query
worked if there were more than 170 records. For any less it gave blank
recordset.
I want to find out the reason for such weird behaviour and if this
some Foxpro limitation
Please reply.
Thank you
.
- References:
- SQL query problem with character comparison.
- From: Leena
- SQL query problem with character comparison.
- Prev by Date: Re: SQL query problem with character comparison.
- Next by Date: Re: No more Foxpro
- Previous by thread: Re: SQL query problem with character comparison.
- Index(es):
Relevant Pages
|