Undefined Element Error

Reply

Join Date: Feb 2008
Posts: 10
Reputation: kory27 is an unknown quantity at this point 
Solved Threads: 0
kory27 kory27 is offline Offline
Newbie Poster

Undefined Element Error

 
0
  #1
Feb 28th, 2008
I had the following stored procedure calling from a .cfm page via the following cfquery command;


this is the cfquery code on my cfm page:

  1. <cfquery name="GetProduct" datasource="Allposters3" cachedwithin="#CreateTimeSpan(0,4,0,0)#">
  2. {CALL spNavProducts (#NavID#)}</cfquery>

below here is the actual sql from spNavProducts which is called:


  1. set ANSI_NULLS ON
  2. set QUOTED_IDENTIFIER ON
  3. go
  4.  
  5.  
  6.  
  7. ALTER PROCEDURE [dbo].[spNavProducts](@NavID int)
  8. AS
  9.  
  10. SET NOCOUNT OFF;
  11. SELECT TOP 500 tblNavProductID.NavID, tblProduct.productId, tblProduct.productCode, tblProduct.productName, tblProduct.productRetailPrice,
  12. tblProduct.productRetailPriceStore, CAST(tblProduct.productRetailPrice * tblProduct.productDiscount AS Money) AS productDiscountPrice,
  13. tblProduct.productSize, tblProduct.productWidth, tblProduct.productHeight, tblProduct.productImg1URL, tblProduct.productStoreOnly,
  14. tblProduct.productNavID, tblNav.NavName, tblProduct.MinFramePrice, tblProduct.productMinFrame, tblProduct.productDiscount,
  15. tblProduct.productUpdDate, tblProduct.productQOH, tblManufacturer.manufacturerTurnaround, tblProduct.ProductInactive, tblProduct.NewProd,
  16. tblProduct.OnSale, tblProduct.MultiSize, tblProduct.Rank, tblProduct.productImg2URL, tblProduct.CanBeFramed, tblProduct.CanBeMounted, tblProduct.ProductType,
  17. tblProduct.ProductLink, tblProduct.ThumbnailHeight, tblProduct.ThumbnailWidth, tblProduct.FramedLink, tblProduct.MountedLink
  18. FROM tblNavProductID INNER JOIN
  19. tblProduct ON tblNavProductID.ProductId = tblProduct.productId INNER JOIN
  20. tblManufacturer ON tblProduct.productManufacturerId = tblManufacturer.manufacturerId LEFT OUTER JOIN
  21. tblNav ON tblProduct.productNavID = tblNav.NavID
  22. WHERE (tblNavProductID.NavID = @NavID) AND (tblProduct.ProductInactive = 0) AND (tblProduct.productCodeParent IS NULL OR
  23. tblProduct.productCodeParent = N'')
  24. ORDER BY tblProduct.Rank DESC, tblProduct.productName
  25.  
  26. set ANSI_NULLS ON
  27. set QUOTED_IDENTIFIER ON
  28. go

!!!!!!!!!!!Start question dialog again here!!!!!!!!!!!!!!!!

Basically, the stored procedure being called is in a database called Allposters3 which is replacing the datasource Urbanposters,
but is an exact copy of the schema of Urbanposters.
I added a few fields to the select clause and when I run the the stored procedure as a view replacing @NavID with an actual
NAVid value, it indeed returns all the fields in the select clause without fail.

Below is the original Store procedure so you can see what i added in the Select clause:

  1. ALTER PROCEDURE [dbo].[spNavProducts](@NavID int)
  2. AS
  3.  
  4. SET NOCOUNT OFF;
  5. SELECT TOP 500 tblNavProductID.NavID, tblProduct.productId, tblProduct.productCode, tblProduct.productName, tblProduct.productRetailPrice,
  6. tblProduct.productRetailPriceStore, CAST(tblProduct.productRetailPrice * tblProduct.productDiscount AS Money) AS productDiscountPrice,
  7. tblProduct.productSize, tblProduct.productWidth, tblProduct.productHeight, tblProduct.productImg1URL, tblProduct.productStoreOnly,
  8. tblProduct.productNavID, tblNav.NavName, tblProduct.MinFramePrice, tblProduct.productMinFrame, tblProduct.productDiscount,
  9. tblProduct.productUpdDate, tblProduct.productQOH, tblManufacturer.manufacturerTurnaround, tblProduct.ProductInactive, tblProduct.NewProd,
  10. tblProduct.OnSale, tblProduct.MultiSize, tblProduct.Rank
  11. FROM tblNavProductID INNER JOIN
  12. tblProduct ON tblNavProductID.ProductId = tblProduct.productId INNER JOIN
  13. tblManufacturer ON tblProduct.productManufacturerId = tblManufacturer.manufacturerId LEFT OUTER JOIN
  14. tblNav ON tblProduct.productNavID = tblNav.NavID
  15. WHERE (tblNavProductID.NavID = @NavID) AND (tblProduct.ProductInactive = 0) AND (tblProduct.productCodeParent IS NULL OR
  16. tblProduct.productCodeParent = N'')
  17. ORDER BY tblProduct.Rank DESC, tblProduct.productName

!!!!!!!!!!!Start question dialog again here!!!!!!!!!!!!!!!!

Now when i call some of those fields on my cfm page in the typical #GetProduct.ProductType# fashion, it returns the error;

Element ProductType is undefined in GetProduct.

Now, I must be missing something little, but it is my understanding that since I added the fields to the spNavProducts that
GetProduct is calling, and I ran the select and the spNavProducts is indeed returning the fields added to the select, well,
Shouldn't allow me to place these elements on the page? I am lost.

Thanks so much for your help in advance.
Last edited by peter_budo; Mar 6th, 2008 at 7:02 am. Reason: Please use [code] tags
Reply With Quote Quick reply to this message  
Join Date: Feb 2008
Posts: 72
Reputation: cmhampton is an unknown quantity at this point 
Solved Threads: 10
cmhampton's Avatar
cmhampton cmhampton is offline Offline
Junior Poster in Training

Re: Undefined Element Error

 
0
  #2
Mar 7th, 2008
You may have already figured this out, but the first thing that comes to mind is that your query has been cached for 4 hours. Because it's a stored procedure and not an inline query, CF will not recognize the the stored proc has changed. Mind you, I'm not suggesting that you make this an inline query, but if you change the stored procedure, keep this in mind. You can either wait until it expires, or you can temporarily remove the cachedwithin value.

I suspect that's what the problem is, but if not, let me know and I will look deeper into your SP.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the ColdFusion Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC