General information
Category:
Databases,Tables, Views, Indexing and SQL syntax
>If you ever have a view based on a view, this kind of thing is possible. When >VFP queries a view, it samples the data in the first few records to determine >the width of the fields. If your base view was queried, and the columns widths >came out to one number, and the seconds view (based on the first) was queried, >then the fist requeried and the columns widths changed, the second would throw >this error. Can you give the SQL that defines both views?
This is the defintion of the remote view: It can change by adding a where clause
if the user has selected something to filter on. The columns do not change
========================================
CREATE SQL VIEW "V_INVENTORY_LIMITED" ;
REMOTE CONNECT "Prototype" ;
AS SELECT IM.STO_Name, IM.INV_ScanCode, IM.INV_PK, IM.INV_Name, IM.INV_Size,;
IM.INV_CPK, IM.BRD_Name, IM.DPT_Name, IM.INV_ReceiptAlias, ;
IM.SIB_BasePrice, IM.INV_AverageCost, IM.INV_LastCost, 0 AS lSelect ;
FROM ecrs.v_InventoryMaster IM
* Criteria supplied, select appropriate records
CREATE SQL VIEW "V_INVENTORY_LIMITED" ;
REMOTE CONNECT "Prototype" ;
AS SELECT IM.STO_Name, IM.INV_ScanCode, IM.INV_PK, IM.INV_Name, IM.INV_Size,;
IM.INV_CPK, IM.BRD_Name, IM.DPT_Name, IM.INV_ReceiptAlias, ;
IM.SIB_BasePrice, IM.INV_AverageCost, IM.INV_LastCost, 0 AS lSelect ;
FROM ecrs.v_InventoryMaster IM ;
WHERE &tcCriteria
DBSetProp('V_INVENTORY_LIMITED', 'View', 'UpdateType', 1)
DBSetProp('V_INVENTORY_LIMITED', 'View', 'WhereType', 3)
DBSetProp('V_INVENTORY_LIMITED', 'View', 'FetchMemo', .T.)
DBSetProp('V_INVENTORY_LIMITED', 'View', 'SendUpdates', .F.)
DBSetProp('V_INVENTORY_LIMITED', 'View', 'UseMemoSize', 255)
DBSetProp('V_INVENTORY_LIMITED', 'View', 'FetchSize', -1)
DBSetProp('V_INVENTORY_LIMITED', 'View', 'MaxRecords', -1)
DBSetProp('V_INVENTORY_LIMITED', 'View', 'Tables', '')
DBSetProp('V_INVENTORY_LIMITED', 'View', 'Prepared', .F.)
DBSetProp('V_INVENTORY_LIMITED', 'View', 'CompareMemo', .T.)
DBSetProp('V_INVENTORY_LIMITED', 'View', 'FetchAsNeeded', .F.)
DBSetProp('V_INVENTORY_LIMITED', 'View', 'FetchSize', -1)
DBSetProp('V_INVENTORY_LIMITED', 'View', 'Comment', "")
DBSetProp('V_INVENTORY_LIMITED', 'View', 'BatchUpdateCount', 1)
DBSetProp('V_INVENTORY_LIMITED', 'View', 'ShareConnection', .T.)
This is the defintion of the local view:
========================================
create view v_orderlook AS ;
select v_inventory_limited.STO_Name, ;
v_inventory_limited.INV_ScanCode, ;
v_inventory_limited.INV_PK, ;
v_inventory_limited.INV_Name, ;
v_inventory_limited.INV_Size, ;
v_inventory_limited.INV_CPK, ;
v_inventory_limited.BRD_Name, ;
v_inventory_limited.DPT_Name, ;
v_inventory_limited.INV_ReceiptAlias, ;
v_inventory_limited.SIB_BasePrice, ;
v_inventory_limited.INV_AverageCost, ;
v_inventory_limited.INV_LastCost, ;
0 as lSelect, ;
v_vendors_limited.ven_companyname, ;
v_orderinfoall.ord_pk, ;
v_orderinfoall.ord_cpk, ;
v_orderinfoall.ORD_QuantityInOrderUnit, ;
v_orderinfoall.ORD_SupplierStockNumber, ;
v_OrderUnitProfiles.oup_name, ;
iif(isnull(v_orderinfoall.ord_asc_fk),v_inventory_limited.inv_receiptalias,v_additionalscancodes.asc_Receiptalias) as receiptalias ;
from v_inventory_limited ;
join v_orderinfoall on v_orderinfoall.ord_inv_fk = v_inventory_limited.inv_pk;
and v_orderinfoall.ord_inv_cfk = v_inventory_limited.inv_cpk ;
left outer join v_additionalscancodes on v_additionalscancodes.asc_pk = v_orderinfoall.ord_asc_fk ;
and v_additionalscancodes.asc_cpk = v_orderinfoall.ord_asc_cfk ;
left outer join v_vendors_limited on v_vendors_limited.ven_pk = v_orderinfoall.ord_ven_fk ;
and v_vendors_limited.ven_cpk = v_orderinfoall.ord_ven_cfk ;
left outer join v_OrderUnitProfiles on v_OrderUnitProfiles.oup_pk = v_orderinfoall.ord_oup_fk ;
and v_OrderUnitProfiles.oup_cpk = v_orderinfoall.ord_oup_cfk
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only