CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.

YesSoftware Forums -> CodeCharge Studio -> ColdFusion

 How to reuse cfprocresult for a stored procedure in a loop?

Print topic Send  topic

Author Message

Posts: 86
Posted: 01/10/2008, 7:24 AM

Just started learning coldfusion here, pretty cool stuff. Anyway, Right now I need to have the following working:

Previously, we had a page that would take 1 value asnd return one row. I need to modify it to take multiple values (done) and return one "row" per value. In essence, just looping each input value. Pretty straight forward.

The problem I am seeing is that inside the loop, I call and run a stored procedure, and store out the results to "result". The input values to the stored procedure change with each pass of the loop.

It appears that when I go through the loop subsequent times, the first value found is still there. I have changed the order of the input and it basically does the same thing each time, overwriting the next values found.

If this was perl, I would think I need to mark the query as "finished" so its resultset name (paraphrasing here of course) could be reused with new result values.

I haven't seen anything like this for Cold Fusion.

Anyone have suggestions on how to do this?

View profile  Send private message

Posts: 31
Posted: 01/22/2008, 2:51 AM

I'm sorry I don't my friend - I'm just a basic user of CFM but do love it - my basic knowledge and CCS are all I need. Two suggestions if you don't get an answer on this thread. Get Ben Forta's WACK book on CFM - best thing since sliced bread. Join CF-Talk at and pop your question in there.

View profile  Send private message

Posts: 86
Posted: 01/22/2008, 4:52 AM

Thanks for the info on the site.

I did find a solution. This issue was that when a resultset was returned that didn't find a value, it didn't update the result object with none found result. Hence, the old previous value was still present.

I put in logic that reset the object to no value on each subsequent run. Ideally of course, using the stored procedure to return multiple values based on all the entries would be preferred,but I don't have access to the stored procedure to make the change.
View profile  Send private message

Add new topic Subscribe to topic   

These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit

MS Access to Web

Convert MS Access to Web.
Join thousands of Web developers who build Web applications with minimal coding.

Home   |    Search   |    Members   |    Register   |    Login

Powered by UltraApps Forum created with CodeCharge Studio
Copyright 2003-2004 by  and YesSoftware, Inc.