Re: Repeating Data - Unsure of my use of cfquery
I got my original form to output the way I wanted it to. Now, I'm trying to actually process and validate that form and I'm running into more errors. I sort of know what I'm doing wrong, but unclear how to fix it. Here is my error: Invalid tag nesting configuration. A query driven CFOUTPUT tag is nested inside a CFOUTPUT tag that also has a QUERY= attribute. This is not allowed. Nesting these tags implies that you want to use grouped processing. However, only the top-level tag can specify the query that drives the processing. brThe error occurred on line 299. Is there an easy way for me to send the file of my processing document on this forum? ~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:331784 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: Repeating Data - Unsure of my use of cfquery
You can put a CFLoop query=foo inside of a cfoutput query=moo tag. -Original Message- From: Steven Sprouse [mailto:sspro...@ccboe.com] Sent: Tuesday, March 16, 2010 10:39 AM To: cf-talk Subject: Re: Repeating Data - Unsure of my use of cfquery I got my original form to output the way I wanted it to. Now, I'm trying to actually process and validate that form and I'm running into more errors. I sort of know what I'm doing wrong, but unclear how to fix it. Here is my error: Invalid tag nesting configuration. A query driven CFOUTPUT tag is nested inside a CFOUTPUT tag that also has a QUERY= attribute. This is not allowed. Nesting these tags implies that you want to use grouped processing. However, only the top-level tag can specify the query that drives the processing. brThe error occurred on line 299. Is there an easy way for me to send the file of my processing document on this forum? ~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:331785 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Repeating Data - Unsure of my use of cfquery
cfoutput query=aQuery cfoutput query=bQuery /cfoutput /cfoutput That is illegal because ColdFusion does some automatic variable scoping that would just not work in such a situation. To do this you have to use the cfloop query... form. I.E. cfoutput cfloop query=aQuery cfloop query=bQuery /cfloop /cfloop /cfoutput Just realize with this from CF is not going to automatically scope the query column names for you and you will have to keep track of the rows. You output will look something like this. #aQuery.aColumn[aQuery.currentRow]# and #bQuery.bColumn[bQuery.currentRow]# ~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:331786 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Repeating Data - Unsure of my use of cfquery
Just so I'm clear, are you saying that I need to change my #aQuery.aColumn[aQuery.currentRow]# formatting within the form? For example, I need to change this: cfoutput query=getSchools option value=#getSchools.SchoolBrief##getSchools.SchoolBrief#br //option/cfoutput /cfselect to this: cfloop query=getSchools option value=#getSchools.SchoolBrief[getSchools.currentRow]##getSchools.SchoolBrief[getSchools.currentRow]#br //option/cfloop /cfselect If so, what is the currentRow value? Just a little confused there. ___ cfoutput query=aQuery cfoutput query=bQuery /cfoutput /cfoutput That is illegal because ColdFusion does some automatic variable scoping that would just not work in such a situation. To do this you have to use the cfloop query... form. I.E. cfoutput cfloop query=aQuery cfloop query=bQuery /cfloop /cfloop /cfoutput Just realize with this from CF is not going to automatically scope the query column names for you and you will have to keep track of the rows. You output will look something like this. #aQuery.aColumn[aQuery.currentRow]# and #bQuery.bColumn[bQuery.currentRow]# ~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:331788 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Repeating Data - Unsure of my use of cfquery
On 3/16/2010 8:22 AM, Steven Sprouse wrote: If so, what is the currentRow value? Just a little confused there. currentRow is one of the values provided by ColdFusion about its query objects, just like columnList and recordCount. It is simple the current row of the record set that is being processed in the current iteration of a query loop, either cfoutput query... or cfloop query... loops. You can use it any time you want to know what iteration you are on. I.E a way to alternate row colors: cfiif aQuery.currentRow MOD 2#darkBackground#/cfif You can normally ignore the need to keep track of the current row when you are looping over a single record set inside of a loop. But once you nest two or more separate query loops inside each other, ColdFusion can no longer know for certain which iteration of which record set do you want to out put at a given point. It falls on you to explicitly tell ColdFusion which iteration to use. I.E. the aQuery.currentRow. ~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:331791 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Repeating Data - Unsure of my use of cfquery
I posted a few days ago about having multiple cfquery statements in the same document. After some troubleshooting, I finally figured out how to do this. I began building my test form, which is populated from fields in a database, I'm running into a problem where the data is just being repeated, to the point where it's making the page extremely slow to load. I have a feeling this is because I didn't use cfquery properly - but I'm not sure how to remedy the situation. The form kept looking over the data more and more as I added new rows querying new data. Any help is much appreciated. ~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:331745 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Repeating Data - Unsure of my use of cfquery
My Code: (link to live page - http://www2.ccboe.com/summeracademy/app/emp/index.cfm) cfquery name=getSchools datasource=filemaker_schools SELECT SchNum, SchoolBrief FROM SCHOOLS ORDER BY SchoolBrief /cfquery cfquery name=getSrastaff datasource=filemaker_srmastaff SELECT ApplySubject, ApplySchool, School, ApplyPosition, YrsPartic, TshirtSize FROM ApplySchoolList, SRAStaff, ApplySubjectGrList, YrsParticList, TshirtSizeList ORDER BY School /cfquery form name=form1 method=post action=/summeracademy/app/app_process.cfm table width=100% cellpadding=2 cellspacing=2 border=0 tr td colspan=4 bgcolor=dceaf3h4Contact and Payroll Information:/h4/td /tr tr td valign=topbApplicant Name:/b/td td valign=topFirst: input name=First type=text/td td valign=topLast: input name=Last type=text/td td valign=topMI: input name=MI type=text/td /tr tr td valign=topbEmployee ID:/b/td td colspan=3 valign=topinput name=EmpID type=text maxlength=6/td /tr tr td valign=topbCurrent Regular School:/b/td td colspan=3 valign=topselect name=CurrentSchool size=1 option selected=selected value=0Select your school/option cfoutput query=getSchools option value=#getSchools.SchoolBrief##getSchools.SchoolBrief#br //option/cfoutput /select/td /tr tr td valign=topbCurrent Grade and/or Subject that you teach:/b/td td colspan=3 valign=topinput name=CurrentSubjectorGr type=text/td /tr tr td valign=topbPhone Numbers:/b/td td valign=topHome: input name=PhoneHome type=text/td td colspan=2 valign=topCell: input name=PhoneCell type=text/td /tr tr td valign=top /td td valign=topWork: input name=PhoneWork type=text/td td colspan=2 valign=topIP Phone ext.: input name=Voicemail type=text/td /tr tr td valign=topbAddress:/b/td td colspan=3 valign=topStreet: input name=Address type=textbr City: input name=City type=text State: input name=State type=text Zip: input name=Zip type=text/td /tr tr td valign=topbEmail:/b/td td colspan=3 valign=top input name=Email type=textbr Please type this carefully so that we can reach you. There are no spaces in an email address./td /tr tr td colspan=4 bgcolor=dceaf3h4Application Information for Summer Academy 2010:/h4/td /tr tr td valign=topbWhat position are you applying for:/b/td td colspan=3 valign=top select name=ApplyPosition size=1 option selected=selected value=0Select a position/option cfoutput query=getSrastaff option value=#getSrastaff.ApplyPosition##getSrastaff.ApplyPosition#/option/cfoutput /select/td /tr tr td valign=topbWhat school would you prefer?/b/td td colspan=3 valign=top select name=ApplyPosition size=1 option selected=selected value=0Select a school/option cfoutput query=getSrastaff option value=#getSrastaff.School##getSrastaff.School#/option/cfoutput /select/td /tr tr td valign=topbIf you do not get your preferred school, mark where you are willing to work:/b/td td colspan=3 valign=top cfoutput query=getSrastaffinput name=SchoolApplyOther type=checkbox value=#getSrastaff.School# / #getSrastaff.School#/cfoutput/td /tr tr td valign=topbWhat
Re: Repeating Data - Unsure of my use of cfquery
Your second query is the problem, both the repeating data and the slowness. You have a full outer join of five tables, which is not what you want. You need inner joins. Here is a simple reference that might help you on your way: http://www.sql-tutorial.net/SQL-JOIN.asp Has a million reference to other pages that might help. If you get that query sorted you should be all set. cheers, barneyb On Mon, Mar 15, 2010 at 6:21 AM, Steven Sprouse sspro...@ccboe.com wrote: My Code: (link to live page - http://www2.ccboe.com/summeracademy/app/emp/index.cfm) cfquery name=getSchools datasource=filemaker_schools SELECT SchNum, SchoolBrief FROM SCHOOLS ORDER BY SchoolBrief /cfquery cfquery name=getSrastaff datasource=filemaker_srmastaff SELECT ApplySubject, ApplySchool, School, ApplyPosition, YrsPartic, TshirtSize FROM ApplySchoolList, SRAStaff, ApplySubjectGrList, YrsParticList, TshirtSizeList ORDER BY School /cfquery form name=form1 method=post action=/summeracademy/app/app_process.cfm table width=100% cellpadding=2 cellspacing=2 border=0 tr td colspan=4 bgcolor=dceaf3h4Contact and Payroll Information:/h4/td /tr tr td valign=topbApplicant Name:/b/td td valign=topFirst: input name=First type=text/td td valign=topLast: input name=Last type=text/td td valign=topMI: input name=MI type=text/td /tr tr td valign=topbEmployee ID:/b/td td colspan=3 valign=topinput name=EmpID type=text maxlength=6/td /tr tr td valign=topbCurrent Regular School:/b/td td colspan=3 valign=topselect name=CurrentSchool size=1 option selected=selected value=0Select your school/option cfoutput query=getSchools option value=#getSchools.SchoolBrief##getSchools.SchoolBrief#br //option/cfoutput /select/td /tr tr td valign=topbCurrent Grade and/or Subject that you teach:/b/td td colspan=3 valign=topinput name=CurrentSubjectorGr type=text/td /tr tr td valign=topbPhone Numbers:/b/td td valign=topHome: input name=PhoneHome type=text/td td colspan=2 valign=topCell: input name=PhoneCell type=text/td /tr tr td valign=top /td td valign=topWork: input name=PhoneWork type=text/td td colspan=2 valign=topIP Phone ext.: input name=Voicemail type=text/td /tr tr td valign=topbAddress:/b/td td colspan=3 valign=topStreet: input name=Address type=textbr City: input name=City type=text State: input name=State type=text Zip: input name=Zip type=text/td /tr tr td valign=topbEmail:/b/td td colspan=3 valign=top input name=Email type=textbr Please type this carefully so that we can reach you. There are no spaces in an email address./td /tr tr td colspan=4 bgcolor=dceaf3h4Application Information for Summer Academy 2010:/h4/td /tr tr td valign=topbWhat position are you applying for:/b/td td colspan=3 valign=top select name=ApplyPosition size=1 option selected=selected value=0Select a position/option cfoutput query=getSrastaff option value=#getSrastaff.ApplyPosition##getSrastaff.ApplyPosition#/option/cfoutput /select/td /tr tr td valign=topbWhat school would you prefer?/b/td td colspan=3 valign=top select name=ApplyPosition size=1 option selected=selected value=0Select a school/option cfoutput query=getSrastaff option value=#getSrastaff.School##getSrastaff.School#/option/cfoutput /select/td /tr tr td valign=topbIf you do not get your preferred school, mark where you are willing to work:/b/td td colspan=3 valign=top cfoutput query=getSrastaffinput name=SchoolApplyOther type=checkbox
Re: Repeating Data - Unsure of my use of cfquery
Looking at the way the data are used, the OP probably needs five queries. The queries are just building options in select inputs. mxAjax / CFAjax docs and other useful articles: http://www.bifrost.com.au/blog/ On 15 March 2010 22:36, Barney Boisvert bboisv...@gmail.com wrote: Your second query is the problem, both the repeating data and the slowness. You have a full outer join of five tables, which is not what you want. You need inner joins. Here is a simple reference that might help you on your way: http://www.sql-tutorial.net/SQL-JOIN.asp Has a million reference to other pages that might help. If you get that query sorted you should be all set. cheers, barneyb On Mon, Mar 15, 2010 at 6:21 AM, Steven Sprouse sspro...@ccboe.com wrote: My Code: (link to live page - http://www2.ccboe.com/summeracademy/app/emp/index.cfm) cfquery name=getSchools datasource=filemaker_schools SELECT SchNum, SchoolBrief FROM SCHOOLS ORDER BY SchoolBrief /cfquery cfquery name=getSrastaff datasource=filemaker_srmastaff SELECT ApplySubject, ApplySchool, School, ApplyPosition, YrsPartic, TshirtSize FROM ApplySchoolList, SRAStaff, ApplySubjectGrList, YrsParticList, TshirtSizeList ORDER BY School /cfquery form name=form1 method=post action=/summeracademy/app/app_process.cfm table width=100% cellpadding=2 cellspacing=2 border=0 tr td colspan=4 bgcolor=dceaf3h4Contact and Payroll Information:/h4/td /tr tr td valign=topbApplicant Name:/b/td td valign=topFirst: input name=First type=text/td td valign=topLast: input name=Last type=text/td td valign=topMI: input name=MI type=text/td /tr tr td valign=topbEmployee ID:/b/td td colspan=3 valign=topinput name=EmpID type=text maxlength=6/td /tr tr td valign=topbCurrent Regular School:/b/td td colspan=3 valign=topselect name=CurrentSchool size=1 option selected=selected value=0Select your school/option cfoutput query=getSchools option value=#getSchools.SchoolBrief##getSchools.SchoolBrief#br //option/cfoutput /select/td /tr tr td valign=topbCurrent Grade and/or Subject that you teach:/b/td td colspan=3 valign=topinput name=CurrentSubjectorGr type=text/td /tr tr td valign=topbPhone Numbers:/b/td td valign=topHome: input name=PhoneHome type=text/td td colspan=2 valign=topCell: input name=PhoneCell type=text/td /tr tr td valign=top /td td valign=topWork: input name=PhoneWork type=text/td td colspan=2 valign=topIP Phone ext.: input name=Voicemail type=text/td /tr tr td valign=topbAddress:/b/td td colspan=3 valign=topStreet: input name=Address type=textbr City: input name=City type=text State: input name=State type=text Zip: input name=Zip type=text/td /tr tr td valign=topbEmail:/b/td td colspan=3 valign=top input name=Email type=textbr Please type this carefully so that we can reach you. There are no spaces in an email address./td /tr tr td colspan=4 bgcolor=dceaf3h4Application Information for Summer Academy 2010:/h4/td /tr tr td valign=topbWhat position are you applying for:/b/td td colspan=3 valign=top select name=ApplyPosition size=1 option selected=selected value=0Select a position/option cfoutput query=getSrastaff option value=#getSrastaff.ApplyPosition##getSrastaff.ApplyPosition#/option/cfoutput /select/td /tr tr td valign=topbWhat school would you prefer?/b/td td colspan=3 valign=top select name=ApplyPosition size=1 option selected=selected value=0Select a school/option cfoutput query=getSrastaff option value=#getSrastaff.School##getSrastaff.School#/option/cfoutput /select/td /tr tr td valign=topbIf you do not get your preferred school, mark where you are willing to work:/b/td td colspan=3 valign=top cfoutput query=getSrastaffinput name=SchoolApplyOther type=checkbox value=#getSrastaff.School# / #getSrastaff.School#/cfoutput/td /tr tr td valign=topbWhat subject do you prefer to teach?/b/td td colspan=3 valign=top select name=SubjectGradePreferred size=1 option selected=selected value=0Select a subject/option cfoutput
Re: Repeating Data - Unsure of my use of cfquery
Barney, would that require that the different tables have a linking relationship? I think that's my problem. There is no common field shared among these tables. ~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:331751 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Repeating Data - Unsure of my use of cfquery
Just separate each table into its own query. Use the data from the right table in the right place and the problem is solved. mxAjax / CFAjax docs and other useful articles: http://www.bifrost.com.au/blog/ On 15 March 2010 22:39, Steven Sprouse sspro...@ccboe.com wrote: Barney, would that require that the different tables have a linking relationship? I think that's my problem. There is no common field shared among these tables. ~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:331752 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Repeating Data - Unsure of my use of cfquery
You guys are awesome. Sometimes it's the easiest things... ~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:331753 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm