I'm currently using CF 5.0 with SQL Server 2K.  I'm using <cfquery> to write the following query:
 
SELECT pi.*, pli.*, pf.*
FROM ((PURCHASE_INVOICE pi INNER JOIN PURCHASE_LINE_ITEMS pli
 ON pi.Invoice_ID = pli.Invoice_ID)
INNER JOIN PURCHASE_FEE pf
 ON pli.Invoice_ID = pf.Invoice_ID AND pli.LineItem_ID = pf.LineItem_ID)
FOR XML AUTO, ELEMENTS
 
I get back a recordset with one col and one row.  The column name is crazy long (40 chars) and is not something I can't predict (i.e. - XML_F52E2B61-18A1-11d1-.....).  I write the following code:
 
<cfloop type="query"><cfoutput>#Evaluate(ListGetAt(temp.columnlist, 1))#</cfoutput></cfquery>
 
I get an error saying that the variable name after "A1-" is invalid.  I'm guessing this is some kind of constraint on CF variable name lengths.
 
I tried reading up on SQL 2K and found that if it was updated to SP3, a string could be returned instead of a recordset when using FOR XML.  Unfortunately, the only code I've found to utilize this is using the ADO COM API.
 
Does anyone know of a way using the FOR XML clause in SQL Server 2K to get that XML doc back into CF using <cfquery> or stored procedures?  Any advice / help would be greatly appreciated.  I'm really stuck here.
 
-Brian

Reply via email to