Bug in queryAddRow/QoQ?


consider following

<cfset qtest = querynew('')>
<cfset queryaddcolumn(qtest, "column1", listtoarray('1.10'))>
<cfdump var="#qtest#"/>

<cfquery name="qtest" dbtype="query">
select * qtest order column1
</cfquery>
<cfdump var="#qtest#"/>

cf identifies column1 decimal when performing qoq , drops trailing '0'. fix, datatype added queryaddcolumn.

<cfset queryaddcolumn(qtest, "column1", "varchar", listtoarray('1.10'))>

column1 identified text, , trailing 0 not removed.
however if new row added using queryaddrow, metadata apparently lost.

<cfset qtest = querynew('')>
<cfset queryaddcolumn(qtest, "column1", "varchar", listtoarray('1.10'))>
<cfset queryaddrow(qtest)>
<cfset querysetcell(qtest,"column1","1.10")>
<cfdump var="#qtest#"/>

<cfquery name="qtest" dbtype="query">
select * qtest order column1
</cfquery>
<cfdump var="#qtest#"/>

i rewrote defining column1 cf_sql_varchar in querynew resolved problem, @ point in application have no idea columns going needed, though know every column should varchar.

my workaround @ point split loop in two, first used determine column names, second used populate query. not ideal far. have recommendations?

what's stranger - if dump after each of
queryaddcolumn(), queryaddrow() , querysetcell() - trailing 0
retained throughout operations. it's after last qoq
that disappears.

i added in cast() last qoq, , did not either,
unfortunately:

select cast(column1 varchar) column1
from qtest
order column1

basically qoq half-arsed implementation. , every time @
(or else looks @ it), more , more evidence amounts demonstrate
this. pity. have been useful tool.

--
adam


More discussions in ColdFusion


adobe

Comments

Popular posts from this blog

Thread: PKI Client 5.00 install (for eToken Pro)

ATmega2560-Arduino Pin Mapping

Crossfader Arduino Tutorial