Ask a Question related to Coldfusion Database Access, Design and Development.
-
DannoParker #1
queryNew() joining to physical table
Can I join a query object (a query created with queryNew()) to a physical
database table? It only works if I return the physical resultset and then join
the two with a query of queries.
<cfset tempQuery = queryNew('field_1)>
<cfset temp = QueryAddRow(tempQuery)>
<cfset temp = querySetCell(tempQuery,'field_1','data',1>
<!--- this won't work --->
<cfquery datasource="this_ds" name="getrealData">
select realData from realTable, tempQuery
where realTable.realData = tempQuery.field_1
</cfquery>
<!--- but this works --->
<cfquery datasource="this_ds" name="getrealData">
select realData from realTable
</cfquery>
<cfquery name="join_tables" dbtype="query">
select *
from tempQuery,getrealData
where tempQuery.field_1= getrealData.realData
</cfquery>
Any help would be greatly appreciated!
DannoParker Guest
-
queryNew and SQL?
Quick question: Is there any way to access the query results of self-built queries (created with queryNew(), queryAddRow(), etc.)with SQL? For... -
Joining Paths or joining two shapes
Hi, I have drawn threeleaves with the pen tool (closed paths). I would like to join these leaves to make a flower into which I want to place an... -
moving the physical log
According to the IDS 9.4 docs, I can move the physical log like this: set IFX=D:\IFMXDATA\ol_bronco copy nul D:\IFMXDATA\ol_bronco\physpace.001... -
Physical Logging performance
Ruediger Yes, this is something I have tried to achieve, it tends to reduce disk I/O to the Physical Log and make the I/O more efficient. I'm... -
Could not load type VTFixup Table from assembly Invalid token in v-table fix-up table.
We are getting this error after clearing the web.config of database infomation - even after using the wizard to re-enter the information. I could... -
mxstu #2
Re: queryNew() joining to physical table
I wouldn't think so. A regular query against a physical database table takes place in the database, which knows nothing about CF query objects residing in CF memory.
mxstu Guest
-
zoeski80 #3
Re: queryNew() joining to physical table
No, you cannot query both the database and QoQ at the same time. The Datasource
details specified within the CFQUERY tag must apply to all the tables being
queried.
If you don't need the data out of the CF query but need to retrieve data based
on its values, you should be able to do something like this:
SELECT RealData
FROM RealTable
WHERE RealDataField IN (#ValueList(tempQuery.tempDataField)#)
But if you need to do a proper join then I think your 2nd bit of code is the
way to go - put real query into CF query and then do the join using QoQ. NB.
QoQ only supports up to 3 table joins I belive.
HTH
Zoe
zoeski80 Guest



Reply With Quote

