The problem is trying to add a struct to the varChar column.

Here is the immediate bit of code at work:
            <cfset queryAddColumn(getEm,"categories","varChar",arrayNew(1))>
            <cfloop query="getEm">
                <cfquery name="getCategories" datasource="#instance.dsn#" 
username="#instance.username#" password="#instance.password#">
                    select    categoryid,categoryname
                    from    tblblogcategories, tblblogentriescategories
                    where    tblblogentriescategories.entryidfk = 
<cfqueryparam value="#getEm.id#" cfsqltype="CF_SQL_VARCHAR" maxlength="35">
                    and        tblblogentriescategories.categoryidfk = 
tblblogcategories.categoryid
                </cfquery>
                <!---
                <cfset 
querySetCell(getEm,"categoryids",valueList(getCategories.categoryID),currentRow)>
                <cfset 
querySetCell(getEm,"categorynames",valueList(getCategories.categoryname),currentRow)>
                --->
                <cfset catData = structNew()>
                <cfloop query="getCategories">
                    <cfset catData[categoryID] = categoryName>
                </cfloop>
                <cfset querySetCell(getEm,"categories",catData,currentRow)>
            </cfloop>

The new column is of type "varChar". That is my addition to make 
querySetCell work at the top of the snippet.
Towards the end a struct called catData is created.
The querySetCell operation tries to add this struct to the modified query 
in the new categoroes column of type varChar.. QuerySetCell works earlier 
in the code and changing the catData struct to a simple string stops the 
error at this point.

I have replicated this with a simpler bit of code and get the same error. 
(see below).

It seems that other CFML engines and older versions of OpenBD allowed 
structs to be added to an untyped query column.

<cfquery name="GetLanguages" datasource="NCRAInfo">
SELECT LanguageID, LanguageName
FROM languages 
ORDER BY LanguageID
</cfquery>

<cfquery name="GetStatus" datasource="NCRAInfo">
    SELECT statusID, Status, Description
    FROM px_status
    ORDER BY statusID
</cfquery>

<cfdump var="#getLanguages#">  

<cfset newGetLanguages = queryAddColumn(getLanguages,"LangFamily", "varChar", 
arrayNew(1))>
<cfdump var="#newGetLanguages#"> 
<p>2 ++++++++++++=</p>
<cfdump var="#getLanguages#"> 
<cfloop query="getLanguages">
    <cfset querySetCell(getLanguages, "langFamily", "new value" ,currentRow)
> 
</cfloop>
<p>3 ++++++++++++=</p>
<cfdump var="#getLanguages#">
<cfloop query="getLanguages">
    <cfloop query="getStatus">
        <cfset catData[statusID] = Status>
    </cfloop>
    <cfdump var="#catData#">
    <cfset querySetCell(getLanguages, "langFamily", catData ,currentRow)> 
</cfloop>
<p>4 ++++++++++++=</p>
<cfdump var="#getLanguages#">



On Saturday, 23 May 2015 03:56:46 UTC-7, Alan Williamson wrote:
>
>  Thanks Magnus.
>  
> Can you do me a favor and pull together an example in a single page that 
> reproduces the problem and log it as an issue with the GitHub site?   We 
> will look at it and see what is going on.
>  
> ------ Original Message ------
> From: "Magnus" <[email protected] <javascript:>>
> To: [email protected] <javascript:>
> Cc: [email protected] <javascript:>
> Sent: 23-May-15 00:13:40
> Subject: Re: [OpenBD] OpenBD vs.BlogCFC
>  
>  
> For the sake of brevity, I will only post one row:
> The value of the new column "categores" is for all the rows [null].
>
>

-- 
-- 
online documentation: http://openbd.org/manual/
 http://groups.google.com/group/openbd?hl=en

--- 
You received this message because you are subscribed to the Google Groups "Open 
BlueDragon" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to