Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Conversion of views from VFP5 to VFP9 - Group by invalid
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows XP
Network:
Windows XP
Database:
Visual FoxPro
Divers
Thread ID:
01183326
Message ID:
01183471
Vues:
16
>Here is the SQL from the view definition:
>SELECT 	VAL(Customer.CODE) AS ValCode,Invhead.*, Ordhead.location, Ordhead.entered,	 ;
>	Ordhead.priorityorder,Ordhead.customerpo,Ordhead.daterequired,Ordhead.comm1, ;
>	Ordhead.comm2, Ordhead.comm3, Ordhead.terms, Customer.NAME,Customer.CODE, Customer.creditlmt, ;
>	Customer.einnumber, Customer.specialdisc, Customer.dollarsuse, Ordhead.customerid, ;
>	Customer.Country AS CustCountry, ProdQty.TotOrdered,ProdQty.TotAllocated, ;
>	ProdQty.TotShipped,.F. AS Ok,RdyToShip.RdyToShip,Shipped.Shipped, ;
>	ProdQty.SpecialOrd,ALLTRIM(STR(Ordhead.OrderId))+IIF(Ordhead.SBO,"B"," ") AS DispOrdNo, ;
>	Customer.OnHold	;
>	FROM frantisi!Invhead, frantisi!Ordhead, frantisi!Customer, frantisi!ProdQty, ;
>	frantisi!RdyToShip,frantisi!Shipped	 ;
>	WHERE Ordhead.customerid = Customer.customerid	;
>	AND Invhead.OrderId = Ordhead.OrderId ;
>	AND	Invhead.OrderId	= Shipped.OrderId ;
>	AND	(((EMPTY(?ldDateReqd)) OR (Ordhead.daterequired <= ?ldDateReqd)) ;
>	OR NOT EMPTY(Invhead.Picked) ) AND ((?lnLocn= 0) ;
>	OR (Ordhead.location = ?lnLocn)) AND EMPTY(DispatchDate) ;
>	ORDER BY 1,Invhead.InvoiceNo
>
>
>------------
>The Key Field is: InvHead.InvoiceNo
>Updateable fields are:
>From InvHead; InvoiceNo,InvoiceDate,DispatchDate,Discount,Tax,Freight,Brokerage,ShipVia,FOBPoint,Pi cked,Currency,Posted
>From OrdHead; Location,Entered,PriorityOreder,CustomerPO,DateRequired,Comm1,Comm2,Comm3
>From Customer; Name,Code,CreditLmt,EINNumber,SpecialDisc,DollarUse,OnHold
>From RdyToShip; RdyToShip
>From Shipped; Shipped
>----------------------------
>I don't understand how this could have worked.
>
>TIA,
>Mike

Yes, the error doesn't make much sense, since you don't have Group BY in this view. The WHERE condition may be re-written into joins and the actual where condition is quite complex, since your parameter may be empty and then we don't need to use this parameter.

Is it possible to make the form to work using views per each table separately? It's usually hard to make updatable view where more than one table is involved.
If it's not broken, fix it until it is.


My Blog
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform