Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
View and SQLEXEC Return Different Results
Message
From
15/09/2006 12:42:03
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
01154007
Message ID:
01154192
Views:
9
>Jim,
>
>You may have index corruption. Try to reindex all tables involved.
>
>>Good suggestion but so far I haven't been able to identify anything that would cause this. But I have discovered that some of the prices in the view are totally unrelated to the data in the table. And some of the data in the tables is duplicated, which shouldn't be happening.

OK, I'm not sure why this fixed the problem, but I had 2 joins on concatenated fields and changing to individual field comparisons I get the same results in the view as I do with SQLEXEC().
*Old join conditions
     JOIN dbo.tblVendorItem itm
         ON inv.inp_Short_Item_Number + inv.inp_Vendor = itm.inp_Short_Item_Number + itm.ven_Vendor_Name
     JOIN dbo.tblVendorItemPriceBreak brk
         ON itm.vit_Sku + itm.ven_Vendor_Name = brk.vit_Sku + brk.ven_Vendor_Name
*New join conditions     
     JOIN dbo.tblVendorItem itm
         ON inv.inp_Short_Item_Number = itm.inp_Short_Item_Number  AND
            inv.inp_Vendor = itm.ven_Vendor_Name
     JOIN dbo.tblVendorItemPriceBreak brk
         ON itm.vit_Sku =brk.vit_Sku AND itm.ven_Vendor_Name = brk.ven_Vendor_Name
Thanks to all who tried to help.
Jim
Previous
Reply
Map
View

Click here to load this message in the networking platform