Question : ColdFusion/SQL Procedure Undefined Variable Problem

Hey Experts,

     I am having a bit of a problem modifying a web application.  I keep receiving an error message that says "Element DISTRICTA is undefined in RSCF_CLIENT"  I know enough to know that there is a problem with a variable but not much beyond that (please bear with, still learning).  I have attach all the pertinent code to the best of my knowledge.  
     The first SELECT statement was previously done and functions perfectly, the second one is the one I am having problems with.  The WHERE condition in the second statement has been modified as a troubleshooting attempt, the 23318 constant is not how it is meant to be but it is a record I have verified to exist in the database table.  I hope all my rambling makes sense to somebody and I thank everybody for their help in advanced.  Please let me know if I need to provide any additional information.



 
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
ColdFusion Code:

    <cfstoredproc procedure="pr_get_LoggedUser_Info" datasource="#Application.CDP_DSN#">
        <cfprocparam type="In" cfsqltype="CF_SQL_INTEGER" value="#rsCF_Client_ID.CID#" null="No">
        <cfprocresult name="rsCF_Client">
    </cfstoredproc>


<cfoutput>#rsCF_Client.DistrictA#</cfoutput>


SQL Procedure Code:

SELECT	ct.ConType_Abbr,
		Ltrim(Rtrim(c.FirstName)) AS FirstName,
		Ltrim(Rtrim(c.LastName)) AS LastName,
		c.CompanyName,
		c.Address,
		c.Address2,
		c.City,
		c.State,
		c.Zip,
		c.EmailAddress,
		ct.ContactType
FROM		cdp_Contacts c, cdp_ContactTypes ct
WHERE	c.ContactType_ID = ct.ContactType_ID
AND		c.Contact_ID = @Logged_CID

SELECT	Contact_ID,
        CompanyName AS DistrictA
FROM	cdp_Contacts
WHERE	Contact_ID = 23318

Answer : ColdFusion/SQL Procedure Undefined Variable Problem

One more thing. Add the resultset number (1,2,...) to each cfprocresult variable

    <cfstoredproc procedure="pr_get_LoggedUser_Info" datasource="#Application.CDP_DSN#">
        <cfprocparam type="In" cfsqltype="CF_SQL_INTEGER" value="#rsCF_Client_ID.CID#" null="No">
        <cfprocresult name="rsCF_Client" resultset="1">
      <cfprocresult name="rsCF_Client2" resultset="2">
    </cfstoredproc>
Random Solutions  
 
programming4us programming4us