Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. sponsors. rss.
 From: tushar
  Where is tushar?
 Panaji
 India
 tushar
 To: Barbara Peisch
  Where is Barbara Peisch?
 Oceanside
 California - United States
 Barbara Peisch
 Tags
Subject: RE: View definition has changed error
Thread ID: 151334 Message ID: 151384 # Views: 50 # Ratings: 0
Version: Visual FoxPro 9 Category: Databases, Tables and SQL Server
Date: Wednesday, November 14, 2007 1:32:01 PM         
   


Barbara

My SWAG. You have a cursor called DXFParts open somewhere.

Regards
Tushar

> I have the following view definition, which is suddenly giving me a "View definition has changed" error when it had been working.
>
>
> CREATE SQL VIEW "OrdAssemPartsView" AS ; 
>    SELECT OrdAssemParts.*, ;
>           AssemParts.AssemblyId, ;
>           AssemParts.DXFPartId, ;
>           AssemParts.OthPartId, ;
>           CAST(OrdDetails.OrdQty*AssemParts.Qty as Integer) as Qty, ;
>           PADR(NVL(Parts.PartName,DXFParts.DXFName),50) as CustPartNo, ;
>           NVL(Units.UnitCode,'   ') as UnitCode, ;
>           NVL(DXFParts.Forming,.F.) as Forming, ;
>           NVL(MatTypes.Descript,SPACE(15)) as MatTypeName, ;
>           NVL(DXFParts.MatPrice,0000000.00) as MatPrice, ;
>           NVL(NVL(Materials.MatName,Parts.Material),SPACE(20)) as MaterialName, ;
>           NVL(Gases.GasName,SPACE(20)) as GasName, ;
>           PADR(NVL(goApp.ThickDesc(Thicknesses.Gauge,Thicknesses.Measuremnt),SPACE(6)),6) as Thickness, ;
>           Thicknesses.Measuremnt, ;
>           NVL(DXFParts.Price2Use,NVL(Parts.PartPrice,0000000.00)) as ItemPrice, ;
>           NVL(DXFParts.CutLength,0000000.000) as CutLength, ;
>           NVL(DXFParts.TotCutTime,000.00) as TotCutTime, ;
>           NVL(DXFParts.MatLength,000.00) as MatLength, ;
>           NVL(DXFParts.MatWidth,000.00) as MatWidth ;
>    from OrdAssemParts ;
>       inner join AssemParts on OrdAssemParts.AssemPrtId = AssemParts.AssemPrtId ;
>       inner join OrdDetails on OrdAssemParts.OrdDetId = OrdDetails.OrdDetId ;
>       left outer join Parts on AssemParts.OthPartId = Parts.PartId ;
>       left outer join Units on Parts.UnitId = Units.UnitId ;
>       left outer join DXFParts on AssemParts.DXFPartId = DXFParts.PartId ;
>       left outer join Materials on DXFParts.MaterialID = Materials.MaterialID ;
>       left outer join Gases on DXFParts.GasID = Gases.GasId ;
>       left outer join MatTypes on DXFParts.MatTypeID = MatTypes.MatTypeID ;
>       left outer join Thicknesses on DXFParts.ThickId = Thicknesses.ThickId ;
>    where llNoFilter OR (AssemParts.AssemblyId = lnAssemblyId AND OrdAssemParts.OrdDetId = lnOrdDetId)
> 

>
> Now, the only thing that I've changed in this view lately is the calculation of the Qty field. That's working perfectly. In fact, everything for all the tables through DXFParts is working just fine. It's only if I add any of the outer joins that appear after that that I have the error. The error also only occurs if I initially open the view with no data, then set the lnAssemblyId and lnOrdDetId variables and try to REQUERY. I've compared the structure of the view when it's empty to when it's populated, and the structure is the same. This is when I populated it by setting llNoFilter to .T., not by setting lnAssemblyId or lnOrdDetId.
>
> And here's the best part! I don't even have to be pulling any fields from those outer join tables to cause the error!
>
> Later...
>
> I've found out a bit more, although I'm no closer to solving the problem. If I look at the structure when the view is empty, the CustPartNo field is 50 characters, as expected, but if I set the variables the way the program is trying to set them when it has a problem, and then populate the view, the CustPartNo field is only 30 characters.
>
> Huh? How can this be when I have a PADR(...50) around that field? And why would removing the last four outer joins, which have nothing to do with the CustPartNo field fix this problem?
>
> -BP
> www.peisch.com



COMPLETE THREAD
View definition has changed error Posted by Barbara Peisch @ 11/14/2007 8:34:25 AM
RE: View definition has changed error Posted by Marcia Akins @ 11/14/2007 12:27:18 PM
RE: View definition has changed error Posted by Barbara Peisch @ 11/14/2007 10:25:18 PM
RE: View definition has changed error Posted by Marcia Akins @ 11/15/2007 11:30:59 AM
RE: View definition has changed error Posted by Barbara Peisch @ 11/15/2007 8:03:16 PM
RE: View definition has changed error Posted by Marcia Akins @ 11/15/2007 8:53:04 PM
RE: View definition has changed error Posted by Cetin Basoz @ 11/14/2007 12:53:24 PM
RE: View definition has changed error Posted by tushar @ 11/14/2007 1:32:01 PM