Re: SQL query problem with character comparison.

Tech-Archive recommends: Fix windows errors by optimizing your registry



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



.



Relevant Pages

  • Re: Foxpro sql limitations
    ... > I am developing an ASP application that has to interface with a Foxpro ... in addition to a SQL Server database. ... > responsibility to deal with as opposed to the DBMS query engine. ... Create a view in SQL Server with your query of the thousands of ml_ids. ...
    (microsoft.public.fox.vfp.queries-sql)
  • RE: Cannot Concatenate fields using Query
    ... the query will list each unique job number and seqence number ... Creating a new unique qualifier (Primary Key) at this point? ... data base, through excel, or create new froms in FoxPro for adding records ...
    (microsoft.public.excel.misc)
  • RE: Can I disable View Designer syntax checking?
    ... third-party tool to edit the views instead of the using the View Designer. ... In the Summary text box of the query page, ... Microsoft FoxPro Technical Support ... Purchase VFP8 here: ...
    (microsoft.public.fox.programmer.exchange)
  • Re: Foxpro sql limitations
    ... > I am developing an ASP application that has to interface with a Foxpro ... > where you can't have more than 20 items in an IN clause. ... > responsibility to deal with as opposed to the DBMS query engine. ... > follow-up queries between the two connections. ...
    (microsoft.public.fox.vfp.queries-sql)
  • Foxpro sql limitations
    ... I am developing an ASP application that has to interface with a Foxpro ... connecting through ODBC and using Jscript as my language of choice. ... where you can't have more than 20 items in an IN clause. ... responsibility to deal with as opposed to the DBMS query engine. ...
    (microsoft.public.fox.vfp.queries-sql)