Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
View and SQLEXEC Return Different Results
Message
From
15/09/2006 07:49:10
 
 
To
15/09/2006 06:58:43
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
01154007
Message ID:
01154019
Views:
13
>>I have a view in a VFE application using dynamic view parameters. Executing the view with 'GAMINC' as the parameter returns 300 records. But executing the query from the view, using SQLEXEC, with the same parameter returns 3,956 records, which is what I would expect. This is the code from the SQLEXEC approach. The actual query code was just copied from the view code with the where clause added.
>>
>>h1 = 4
>>TEXT TO csql NOSHOW PRETEXT 7
>>SELECT inv.inp_Vendor,
>>      inv.inp_Long_Item_Name,
>>      inv.inp_Long_Item_Number,
>>      prc.own_Owner_Code,
>>      prc.inp_Short_Item_Number,
>>      prc.prl_Price_List_Code,
>>      prc.pri_term,
>>      prc.pri_Current_Price,
>>      itm.vit_Sku,
>>      brk.vpb_Vendor_Unit_Price,
>>      ity.ity_Inventory_Type_Name
>>   FROM dbo.tblInventoryPrice prc
>>      JOIN dbo.tblInventoryPrimary inv
>>         ON prc.inp_Short_Item_Number = inv.inp_Short_Item_Number
>>      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
>>      JOIN dbo.tblInventoryType ity
>>         ON inv.ity_Inventory_Type_Code = ity.ity_Inventory_Type_Code
>>   WHERE inv.inp_vendor = 'GAMINC'
>>ENDTEXT
>>?SQLEXEC(h1,csql,'results')
>>
>>Can anyone suggest where I should start looking to resolve this?
>>
>>TIA,
>
>check SET ANSI

Fabio,

Thanks for the response but that's not the difference - in both cases ANSI is OFF and a quick scan of the inp_Vendor field returned by the SQLEXEC shows they are all 6 characters long.

Any other thoughts?

TIA,
Jim
Previous
Reply
Map
View

Click here to load this message in the networking platform