Three lines using ueryAddColumn in blog.cfc need to updarted as follows:

line 1003 change to 
<cfset queryAddColumn(query=getC, column="entrycount", valueArray=
arrayNew(1))>

line 1492 change to 
<cfset queryAddColumn(query=getEm, column="commentCount",valueArray=
arrayNew(1))>

line 1513 change to 
<cfset queryAddColumn(query=getEm, column="categories",valueArray=
arrayNew(1))>

There are some other problems to be fixed but thiis allows the site 
function.
Magnus



On Saturday, 23 May 2015 18:09:25 UTC-7, Magnus wrote:
>
> I went back and used named parameters on the queryAddColumn function and 
> excluded the datatype parameter like this:
> <cfset queryAddColumn(query=getEm, column="categories", valueArray=
> arrayNew(1))>
>
> This left the column datatype undefined and allowed a struct ( and 
> presumable other complex variables) to be assigned to the query cell.
>
> I haven`t gone through the whole blogCFC site yet but it is now loading 
> and displaying successfully.
>
> I will post a list of the line numbers in blog.cfc that need to be changed 
> later.
>
> Magnus
>
> On Saturday, 23 May 2015 17:56:16 UTC-7, Magnus wrote:
>>
>> The problem seems to be trying to add a  struct to the "varChar" typed 
>> new column.
>>
>> Here is the code that is a work here: 
>>
>>             <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>
>> Line 1 adds a new column of type "varChar" to the query. The includion of 
>> the datatype is my addition to get this function to work.
>>
>> Later on near the end a struct *catData* is created of values from 
>> another query. Then querySetCell is used to try to add this strcut to the 
>> new varChar-typed column. This errors with *Invalid data for column of 
>> type null*.
>>
>> I have replicated this with some simpler code and get the same error. One 
>> thing is that the error message doesn`t seem to be picking up the column 
>> type making  it a little confusing. But it should error as the data doesn`t 
>> match the column type.
>>
>> Then I had a little revelation...
>>
>> 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]>
>>> To: [email protected]
>>> Cc: [email protected]
>>> 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