It is MX, but the loop/index solution works well. Thank you so much. I also tried using cfoutput in place of the cfloop, but that failed in a similar way to the first approach.
Thanks, bill On Nov 30, 11:21 pm, "James Dismukes" <[EMAIL PROTECTED]> wrote: > Just out of curiosity, what version of Coldfusion are you having this happen > on? I had this happen before with CF5 and I could not figure out why. I > can't remember having this with MX or later though. Here's yet another way > to output the results that I've never had any trouble with. > > <cfloop from="1" to="#getrecord.recordcount#" index="i"> > #REC_IDX[i]# > </cfloop> > > > > -----Original Message----- > From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf > > Of Mike Gillespie > Sent: Friday, November 30, 2007 4:00 PM > To: Houston ColdFusion Users' Group > Subject: [houcfug] Re: returning multiple rows of an Oracle Stored Procedure > > Sometimes CF acts funny in loops; I see this behavior in other things, > neve been able to figure out what causes it but have a workaround when > I see it.. The way I fix it is to set each var in the top of the loop > and THEN use that new var where I need it within the loop. > > For example > <cfloop query="one"> > <cfset column1val=one.col1> > <cfset column2val=one.col2> > <cfprocparam type="in" value="#column1val#" dbvarname="bcmid" > cfsqltype="cf_sql_varchar"> > <cfprocparam type="in" value="#column2val#" dbvarname="rectype" > cfsqltype="cf_sql_integer"> > </cfloop> > > Also I noticed you are doing a loop on the query and then embedding a > cfoutput. Might try just a cfoutput of the query > > <cfoutput query="one"></cfoutput> > > M > > On Nov 30, 3:53 pm, [EMAIL PROTECTED] wrote: > > I have a dilemma. > > > I thought I could use this syntax: <cfloop query="getrecord"> to loop > > through the oracle query in a sp, but the loop doesn't seem to be > > iterating... however, when I do a cfdump of getrecord it properly shows > > me all ten records in the query result set. > > > The cfloop iterates ten times (reflecting the correct number of > > records in the result set) and the RecordCount returns 10, but i'm > > only seeing the value of the first record repeated ten times. > > > <cfstoredproc datasource="#request.dsn#" procedure="#request.proc#" > > blockfactor="50"> > > <cfprocparam type="in" value="#spp_BCM_ID#" dbvarname="bcmid" > > cfsqltype="cf_sql_varchar"> > > <cfprocparam type="in" value="#spp_rec_type#" dbvarname="rectype" > > cfsqltype="cf_sql_integer"> > > <cfprocparam type="in" value="#spp_fy#" dbvarname="fy" > > cfsqltype="cf_sql_integer"> > > <cfprocresult name="getrecord"/> > > </cfstoredproc> > > > <!-- This shows all records correctly in the result set --> > > <cfdump var="#getrecord#"> > > > <!-- This loops RecordCount times, but keeps showing only the values > > from the first record --> > > <cfloop query="getrecord"> > > <cfoutput>#getrecord.REC_IDX# > > </cfloop> > > > Anyone got any ideas?- Hide quoted text - > > - Show quoted text - --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the "Houston ColdFusion Users' Group" discussion list. To unsubscribe, send email to [EMAIL PROTECTED] For more options, visit http://groups.google.com/group/houcfug?hl=en -~----------~----~----~----~------~----~------~--~---
