User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the ColdFusion section within the Web Development category of DaniWeb, a massive community of 361,922 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,648 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our ColdFusion advertiser:

Undefined Element Error

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

Undefined Element Error

  #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:

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

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


set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
go



ALTER PROCEDURE [dbo].[spNavProducts](@NavID int)
AS

SET NOCOUNT OFF;
SELECT     TOP 500 tblNavProductID.NavID, tblProduct.productId, tblProduct.productCode, tblProduct.productName, tblProduct.productRetailPrice,
                      tblProduct.productRetailPriceStore, CAST(tblProduct.productRetailPrice * tblProduct.productDiscount AS Money) AS productDiscountPrice,
                      tblProduct.productSize, tblProduct.productWidth, tblProduct.productHeight, tblProduct.productImg1URL, tblProduct.productStoreOnly,
                      tblProduct.productNavID, tblNav.NavName, tblProduct.MinFramePrice, tblProduct.productMinFrame, tblProduct.productDiscount,
                      tblProduct.productUpdDate, tblProduct.productQOH, tblManufacturer.manufacturerTurnaround, tblProduct.ProductInactive, tblProduct.NewProd,
                      tblProduct.OnSale, tblProduct.MultiSize, tblProduct.Rank, tblProduct.productImg2URL, tblProduct.CanBeFramed, tblProduct.CanBeMounted, tblProduct.ProductType,
                      tblProduct.ProductLink, tblProduct.ThumbnailHeight, tblProduct.ThumbnailWidth, tblProduct.FramedLink, tblProduct.MountedLink
FROM         tblNavProductID INNER JOIN
                      tblProduct ON tblNavProductID.ProductId = tblProduct.productId INNER JOIN
                      tblManufacturer ON tblProduct.productManufacturerId = tblManufacturer.manufacturerId LEFT OUTER JOIN
                      tblNav ON tblProduct.productNavID = tblNav.NavID
WHERE     (tblNavProductID.NavID = @NavID) AND (tblProduct.ProductInactive = 0) AND (tblProduct.productCodeParent IS NULL OR
                      tblProduct.productCodeParent = N'')
ORDER BY tblProduct.Rank DESC, tblProduct.productName 

set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
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:

ALTER PROCEDURE [dbo].[spNavProducts](@NavID int)
AS

SET NOCOUNT OFF;
SELECT     TOP 500 tblNavProductID.NavID, tblProduct.productId, tblProduct.productCode, tblProduct.productName, tblProduct.productRetailPrice,
                      tblProduct.productRetailPriceStore, CAST(tblProduct.productRetailPrice * tblProduct.productDiscount AS Money) AS productDiscountPrice,
                      tblProduct.productSize, tblProduct.productWidth, tblProduct.productHeight, tblProduct.productImg1URL, tblProduct.productStoreOnly,
                      tblProduct.productNavID, tblNav.NavName, tblProduct.MinFramePrice, tblProduct.productMinFrame, tblProduct.productDiscount,
                      tblProduct.productUpdDate, tblProduct.productQOH, tblManufacturer.manufacturerTurnaround, tblProduct.ProductInactive, tblProduct.NewProd,
                      tblProduct.OnSale, tblProduct.MultiSize, tblProduct.Rank 
FROM         tblNavProductID INNER JOIN
                      tblProduct ON tblNavProductID.ProductId = tblProduct.productId INNER JOIN
                      tblManufacturer ON tblProduct.productManufacturerId = tblManufacturer.manufacturerId LEFT OUTER JOIN
                      tblNav ON tblProduct.productNavID = tblNav.NavID
WHERE     (tblNavProductID.NavID = @NavID) AND (tblProduct.ProductInactive = 0) AND (tblProduct.productCodeParent IS NULL OR
                      tblProduct.productCodeParent = N'')
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 6:02 am. Reason: Please use [code] tags
AddThis Social Bookmark Button
Reply With Quote  
All times are GMT -4. The time now is 10:22 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC