Solved

VFP 8 vs. VFP 9 ENGINEBEHAVIOR

Posted on 2013-11-27
2
620 Views
Last Modified: 2013-11-27
I am having a problem where a query produces different results based on whether it's run in VFP 8 or VFP 9. Here is the query :

SELECT DISTINCT gage.gageno, gage.loc, gage.lastused, gage.duedate, gage.outofserv, gage.gagedesc, gage.customer, gagepart.partno
FROM gage LEFT JOIN gagepart ON ALLTRIM(gage.gageno) = ALLTRIM(gagepart.gageno)
WHERE LEFT(gage.gageno,6) == '13-01-' INTO CURSOR fred

The following are settings in both versions :

ANSI = OFF
EXACT = OFF
ENGINEBEHAVIOR = 70

When run in 9, the query includes a record where the GAGEPART table contains a record with a blank gageno field. When run in 8, it does not. I know I could rectify this by replacing the = in the JOIN clause with a ==, but I'm looking for the reason why this happens. Is there some other setting I need to look at ?

Any insight here would be appreciated.
0
Comment
Question by:AlanArons
2 Comments
 
LVL 41

Accepted Solution

by:
pcelba earned 500 total points
ID: 39681594
SET EXACT is not important here. Other settings which could affect the result are: SET COLLATE, CPCURRENT(), CPDBF(), and maybe SET DELETED.

The row having empty gagepart.gageno should be on output in all cases because SET ANSI OFF forces the string comparison to the length of the shorter of both strings - so if one of the strings contains just spaces the ALLTRIM converts it to zero length string and the JOIN condition must be True because you are comparing two zero length strings.

I cannot test this behavior in VFP 8 just now but I am sure VFP 9 has many previous bugs  fixed... so let say this was bug in SQL engine prior to VFP 9 (if this is not caused by Collation or Code Page settings).

SET ANSI ON removes blank gagepart.gageno records from output.
0
 

Author Closing Comment

by:AlanArons
ID: 39681689
I was afraid that might be the case.   It occurred to me that the result in 8 given the settings should be incorrect.   I was trying to avoid having to go through all of our code and try and find where this might apply.   Looks like we should turn ANSI on in the programs while still running in 8 (I can do it in the base class for the form.)  and see if it affects anything.  Then when we go to 9 it shouldn't have an effect.  

Thanks for your help.
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
How to command a termical printer from VFP? 4 160
Search for a String within a String 3 361
dedupe in foxpro 12 453
@ ... say c_Symbol in Visual Foxpro 9.0 SP2 in Windows 8 5 359
Microsoft Visual FoxPro (short VFP) is a programming language with it’s own IDE and database, ranking somewhat between Access and VB.NET + SQL Server (Express). Product Description: http://msdn.microsoft.com/en-us/vfoxpro/default.aspx (http://msd…
When we talk about DevOps toolchains, I sometimes wonder how many people really get what we’re talking about. I don’t know if it’s just semantics or tone or something else, but sometimes I think it just sounds like buzzword sausage. So it’s always …
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now