need to convert this to cfc component
Hi,
I need help from you guys, I have a query like this which returns some columns and from loop we are getting some values from other queries depending up on first query values like joins.
I need to make this in to CFC and need to return results from first query as well as from the loop queries.
Is there is any way to do this to convert in component.
I need to return result which is shown in cfoutput below.
Thanks
<cfquery name="myquery" datasource="scott">
select empno,ename,deptno,job,mgr,sal from emp
</cfquery>
<cfloop query="myquery">
<cfquery name="test1" datasource="scott">
select dname,loc from dept where deptno =#myquery.deptno#
</cfquery>
<cfquery name="test2" datasource="coldfusion">
select job,hiredate from emp where deptno=#myquery.deptno#
</cfquery>
<cfoutput>
<table border="1" width="75%">
<tr >
<td >
<b>First Query</b>#myquery.empno#,#myquery.ename#,#myquery.deptno#
<b>Second Query</b>#test1.dname#,#test1.loc#
<b>Third Query</b>#test2.job#,#DateFormat(test2.hiredate,"mm/dd/yyyy")#
</td>
</tr>
</table>
</cfoutput>
</cfloop>
