Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Inconsistent reads thru ODBC
Message
 
To
All
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Inconsistent reads thru ODBC
Miscellaneous
Thread ID:
00880760
Message ID:
00880760
Views:
45
I am running this query against my local table thru ODBC and getting different results each time. The behavior is consistant when not going thru ODBC or when using ODBC against the same table in Access, Pervasive, or SQL Server.

This is very scary! I always assumed I could trust VFP data even when talking thru ODBC.

What Gives!????
clear all 
close all
release all
private pDate
pDate={'02/11/2004 12:00:00 AM'}
SET ENGINEBEHAVIOR 70
lcSql = [select acct_bal.*, cases.pk as cases_pk, ] +;
		[trustee_no.pk as trustee_no_pk, trustee_no.tid as trustee_no_tid ] +;
		[from Acct_Bal ] +;
		[left join cases on cases.case_no = acct_bal.case_no ] +;
		[left join trustee_no on trustee_no.tid = acct_bal.tid ] +;
		[where acct_bal.bal_date = ?pDate ] +;
		[having ISNULL(cases_pk) ]  && This syntax only for VFP ODBC
ch=sqlstringconnect(tcConnectionString)
=sqlexec(ch,lcSql,'curTest')		
?RECCOUNT('curTest')   && Always the same number of records (112,349)
=SQLDISCONNECT(ch)
select * from curTest into cursor curTest2 group by tid, case_no into cursor curTest2
?RECCOUNT('curTest2')  && DIFFERENT EACH RUN!!!!  (19,115 to 20,449 range on 40 runs)
Side question: I originally had the having ISNUll(cases_pk) as part of the where (where ... and cases_pk is null) which VFP liked natively (and SQL ODBC), but does not like this syntax going thru ODBC to VFP. Why is the VFP syntax requirements different when going thru ODBC then when running natively?

Troy
Next
Reply
Map
View

Click here to load this message in the networking platform