Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Getting ERROR, Querying a Query.. using dbtype

0 views
Skip to first unread message

SiuperTosqMan =)

unread,
Nov 3, 2003, 7:46:02 PM11/3/03
to
Well, I have this 2 queries bellow and I would like to create another type of solution, with another 2 new queries but doing "querying a query", using the dbtype attribute.. so lets see:

I have this 2 queries (first block of code):

<cfquery name="qGetCategorias" datasource="DSN">
SELECT *
FROM Categorias
ORDER BY CatNome ASC
</cfquery>

<cfquery name="qListProd" datasource="DSN">
SELECT ProID, Fabricante, ProNome, ProDesc, ProValor, CatID
FROM Produtos
WHERE ProID = #URL.ProID#
ORDER BY ProID ASC
</cfquery>

And I would like to create another 2 queries but with a "querying a query" solution.
Knowing this, I try this code but I have not the same result as I do with the first block of queries above..
Look my tentative:

Second block of code:

<cfquery name="qGetCatAndProd" datasource="DSN">
SELECT Categorias.CatID, Categorias.CatNome, Produtos.ProID,
Produtos.Fabricante, Produtos.ProNome, Produtos.ProDesc,
Produtos.ProValor, Produtos.CatID
FROM Categorias, Produtos
ORDER BY Categorias.CatNome ASC
</cfquery>

<cfquery name="qToUseInSelect" dbtype="query">
SELECT *
FROM qGetCatAndProd
WHERE ProID = #URL.ProID#
ORDER BY ProID ASC
</cfquery>


So, What I have to do in the SECOND BLOCK of code to have the same results as I have with the FIRST BLOCK OF QUERIES??


0 new messages