Sorry I didn't respond immediately- I went home sick yesterday afternoon. The 2nd example shows the correct person but everyone comes up with the 1st persons answers. When I do a regular output each person comes up with the correct answers--once I add cfset each person receives the answers for the 1st person! I originally did a join (there are 6 tables making the actual table- 2 of which are one to many)and used CFPROCRESULT to get the answers. Again getting the output format wasn't working correctly when using the cfset- once I did a cfset it would only give me one page for the results- showing the first person's name/answers-when I looped it I got many pages- each page had the 1st persons name/answers.
I then did my stored procedure with 2 queries one pulls all the "one to one" info and then the second one that pulls the "one to many" info. I use several CFPROCRESULT tags to display the info. Again it displays fine until I add in the cfset tags. (But when I do the exact thing as 2 separate cfqueries and use the cfset it works like a charm!) I find this very bizarre. I have them (cfquery/cfproc) literally set up the same- they both work fine with a regular cfoutput- add the cfset and suddenly the stored procedure doesn't put out the info that needs to loop (ie: the answers)... Can someone do a small demo and see if they get the same results? Thanks J ps. my first cfoutput in my code did use the id as a group-I just forgot to put that in: <CFOUTPUT QUERY="QOne" GROUP="ID"> -----Original Message----- From: Mark A. Kruger - CFG [mailto:[EMAIL PROTECTED]] Sent: Thursday, March 28, 2002 1:48 PM To: CF-Talk Subject: RE: cfset/cfstoredproc Janine, I don't think I'm following your example. What's wrong with the second example? also, why do you need 2 queries? Why not a join? a join would give you columns of name , answer name, answer, name, answer name, answer ORder by name and make sure there is a PK ... then do this: <cfoutput query="myQuery" group="name"> #name# (or <Cfset theName = name > if you like) <cfoutput group="PK"> ... Use the PK to ensure all records are iterated.... #answer# (or <cfset Answer1 = answer>) </cfoutput> </cfoutput> Still... I'm not sure I know exactly what the problem is from the example below. -Mark ************* your example ********************* This is somewhat of a repost from the other day but haven't gotten any feedback- since I don't think I worded my problem very well. I am moving some of my work from cfquery to storedprocedures- the problem is the formatting when I use cfset with a stored procedures- they don't react the same way as a cfquery does... I need the info to show as such Mark: 1. A 2. B 3. A Mary 1. A 2. A 3. D John 1. C 2. A 3. B To achieve this with cfquery I did this: <CFOUTPUT QUERY="QOne"> <CFSET NAME= One.FIRSTNAME> <CFLOOP QUERY ="QTwo"> <CFSET One=QTwo.Answer[1]> <CFSET Two=QTwo.Answer[2]> <CFSET Three=QTwo.Answer[3]> </CFLOOP> </CFOUTPUT> If I do the same with a stored procedure I end up with Mark: 1. A 2. B 3. A Mary 1. A 2. B 3. A John 1. A 2. B 3. A I can't use just a regular output like Ben Forta shows in this CF5 book-I've tried all his solutions but they all deal with regular outputs(which works fine with the cfquery and cfstored proc)- I need to use a cfset statement because each answer needs its own name. Has anyone run across this? What's the best solution? ______________________________________________________________________ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists