Question
Query of query
I have 2 calls to the same DB I want the first function to
make the call and the second to take just the distinct brands from
the first query. How does one function kick off another? Does
anyone have a sample of this?
<cffunction name="Inventory" access="remote" returnType="query" output="false">
<cfargument name="supplierid" required="false">
<CFQUERY NAME="Inventory" DATASOURCE="COREDATA">
SELECT PNUM5W, PDES5W, SDIVDE, ISCF3W, DIVN5W, COMC5W, COMCDE, PGMJ5W, PGMJDE, SUBSTRING(ANAC5W, 2,14) AS ANAC5W
FROM InvYY
WHERE PGMJ5W = '#SupplierID#'
ORDER BY PDES5W, SDIVDE, PNUM5W
</CFQUERY>
<cfreturn Inventory>
</cffunction>
<cffunction name="Brands" access="remote" returnType="query" output="false">
<cfargument name="supplierid" required="false">
<CFQUERY NAME="Brands" DATASOURCE="COREDATA">
SELECT DISTINCT COMC5W AS data, COMCDE AS label
FROM InvYY
WHERE PGMJ5W = '#SupplierID#'
ORDER BY COMCDE
</cfquery>
<cfreturn Brands>
</cffunction>
<cffunction name="Inventory" access="remote" returnType="query" output="false">
<cfargument name="supplierid" required="false">
<CFQUERY NAME="Inventory" DATASOURCE="COREDATA">
SELECT PNUM5W, PDES5W, SDIVDE, ISCF3W, DIVN5W, COMC5W, COMCDE, PGMJ5W, PGMJDE, SUBSTRING(ANAC5W, 2,14) AS ANAC5W
FROM InvYY
WHERE PGMJ5W = '#SupplierID#'
ORDER BY PDES5W, SDIVDE, PNUM5W
</CFQUERY>
<cfreturn Inventory>
</cffunction>
<cffunction name="Brands" access="remote" returnType="query" output="false">
<cfargument name="supplierid" required="false">
<CFQUERY NAME="Brands" DATASOURCE="COREDATA">
SELECT DISTINCT COMC5W AS data, COMCDE AS label
FROM InvYY
WHERE PGMJ5W = '#SupplierID#'
ORDER BY COMCDE
</cfquery>
<cfreturn Brands>
</cffunction>
