[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now


Multiple tables with Stored Procedures

Posted on 2004-04-29
Medium Priority
Last Modified: 2013-12-24

I'm calling a stored procedure. It returns two tables. Using <cfquery> how do I assign the two tables to two variables/structures/queries?



<cfquery datasource="#dsource#" name="findAccomsByAliasList">
      DECLARE @RC int
      DECLARE @licence varchar(128)
      DECLARE @aliasSetType varchar(8000)
      DECLARE @imgSize varchar(128)
      DECLARE @imgPrefix varchar(128)
      DECLARE @imgFileType varchar(128)
      DECLARE @imgOperatorLogo varchar(128)
      SELECT @licence = '#licence#'
      SELECT @aliasSetType = '#aliasSetType#'
      EXEC @RC = [TrailStream].[dbo].[findAccomsByAliasList] @licence, @aliasSetType, DEFAULT, DEFAULT, DEFAULT, DEFAULT
Question by:Stoke
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
LVL 17

Expert Comment

ID: 10954313
Use the tag cfstoredproc and cfprocresult for each result.

<cfstoredproc ............>
    <cfprocparam .............>
    <cfprocresult name="qOne" resultset="1">
    <cfprocresult name="qTwo" resultset="2">

Author Comment

ID: 10957446
But I get the following error:

Invalid CFML construct found on line 30 at column 55.
ColdFusion was looking at the following text:


# An expression that began on line 28, column 64.
Your expression might be missing an ending "#" (it might look like #expr ).
# the tag attribute "value", on line 28, column 43.
# a cfprocparam tag beginning on line 26, column 26.
# a cfprocparam tag beginning on line 26, column 26
LVL 17

Expert Comment

ID: 10957728
Can I see your code? I hope you did not exactly copied what I typed, what I typed was just to give you an idea ;-)
Understanding Web Applications

Without even knowing it, most of us are using web applications on a daily basis. Gmail and Yahoo email, Twitter, Facebook, and eBay are used by most of us daily—and they are web applications. We often confuse these web applications tools for websites.  So, what is the difference?


Author Comment

ID: 10957851
Sure... Thank you:

<cfstoredproc datasource="#dsource#" procedure="findAliasList" >
      <cfprocparam type = "IN"
             CFSQLType = CF_SQL_VARCHAR
                    value = "#licence#"  dbVarName = @licence >
      <cfprocparam type = "IN"
             CFSQLType = CF_SQL_VARCHAR
                    value = "aliasSetType#"  dbVarName = @aliasSetType >

      <cfprocresult name = "qONE" resultset="1">
      <cfprocresult name = "qTWO" resultSet = "2">
LVL 17

Accepted Solution

Tacobell777 earned 200 total points
ID: 10958061
 dbVarName does not work, you need to pass the parameters in the order the are in the SP.

the problem is here
<cfprocparam type = "IN"
           CFSQLType = CF_SQL_VARCHAR
                 value = "aliasSetType#"  dbVarName = @aliasSetType >

it needs to be

<cfprocparam type = "IN"
           CFSQLType = CF_SQL_VARCHAR
                 value = "#aliasSetType#"  dbVarName = @aliasSetType >

you were missing a # infront of aliassettype

Author Comment

ID: 10958097
That's great. Thanks... That's going to prove really useful.

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When it comes to showing a 404 error page to your visitors, you do not want that generic page to show, and you especially do not want your hosting provider’s ad error page to show either. In this article, I will show you how to enable the custom 40…
When it comes to security, close monitoring is a must. According to WhiteHat Security annual report, a substantial number of all web applications are vulnerable always. Monitis offers a new product - fully-featured Website security monitoring and pr…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
Suggested Courses

650 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question