Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Returns more than one resultset. How?

Contributor ,
Oct 28, 2008 Oct 28, 2008
I have a Stored Proc that returns 4 resultsets, how will I invoke them from a cfm page to get each resultset?
Below is my proc. The Proc is in a CFC
TOPICS
Getting started
588
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

LEGEND , Oct 29, 2008 Oct 29, 2008
umuayo wrote:
> Hi,
>
> The Proc is in a CFC. I need to invoke the cfc from the cfm page to return cfstoredproc query results.

Then just do that.

Of course you can only return one value from a function so you will need
to put those four results into an array or structure or something to
group them together.

Then use the complex variable of your choice in the cfm page.

Translate
Valorous Hero ,
Oct 28, 2008 Oct 28, 2008
> how will I invoke them from a cfm page to get each resultset

What do you mean invoke? The code above should create four query objects: results1, result2, results3, results4. You can use them as you would any other query object (output, loop through them, etc..)

<cfoutput query="results1">
....
</cfoutput>
<cfoutput query="results2">
....
</cfoutput>
...
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Oct 29, 2008 Oct 29, 2008
Hi,

The Proc is in a CFC. I need to invoke the cfc from the cfm page to return cfstoredproc query results.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Oct 29, 2008 Oct 29, 2008
umuayo wrote:
> Hi,
>
> The Proc is in a CFC. I need to invoke the cfc from the cfm page to return cfstoredproc query results.

Then just do that.

Of course you can only return one value from a function so you will need
to put those four results into an array or structure or something to
group them together.

Then use the complex variable of your choice in the cfm page.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Oct 29, 2008 Oct 29, 2008
LATEST
Thanks thats basically what I have just done and it is getting all the desired results.
<!--- PASS RECORDS AS AN ARRAY --->
<cfset results = ArrayNew(1) />
<cfset results[1] = results1 />
<cfset results[2] = results2 />
<cfset results[3] = results3 />
<cfset results[4] = results4 />
<cfreturn results />
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources