ColdFusion Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreColdFusion Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old September 11th, 2004, 01:31 PM
brokerandy25 brokerandy25 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2004
Posts: 4 brokerandy25 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via AIM to brokerandy25
passing a list as a variable

I would love any assistance that anyone could provide. I have a list box that the user can select multiple Apartment Communities. their value are tied to the AutoNumber, Cust_ID field in the DB. I need to be able to pass this list of multiple values through a variable to a new page that will query the database for the Apartment Communities that match the Cust ID variable list, output in some format, I am not sure what I want the page to look yet, but I do know that it will be outputted as email

HELP!!!!!!!!!

Thanks, Andy

Reply With Quote
  #2  
Old September 11th, 2004, 11:57 PM
kaasu kaasu is offline
Web Developer
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Posts: 58 kaasu User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 1 m 4 sec
Reputation Power: 5
You list box values will be submitted as a comma separated value to your form action page. So to get the result from your db, you can do something like this

select..
from yourtable
where custid in (#form.yourselectboxname#)

Hope it helps

Reply With Quote
  #3  
Old September 12th, 2004, 11:41 AM
brokerandy25 brokerandy25 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2004
Posts: 4 brokerandy25 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via AIM to brokerandy25
I tried that and the error I got was:

Error Executing Database Query.
[Macromedia][SequeLink JDBC Driver][ODBC Socket][Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 1.

The error occurred in C:\CFusionMX\wwwroot\LeasingSolutionsInc\emailconfirm.cfm: line 7

5 :
6 : <cfquery name="ApartmentQuery" datasource="LeasingSolution_Big_DB">
7 : SELECT * FROM Apartment_Communities_ProductionDB WHERE Cust_ID IN (#CustID#)
8 : </cfquery>
9 : <cfquery name="NameandEmail" datasource="LeasingSolution_Big_DB">



--------------------------------------------------------------------------------

SQL SELECT * FROM Apartment_Communities_ProductionDB WHERE Cust_ID IN (1)
DATASOURCE LeasingSolution_Big_DB
VENDORERRORCODE -3010
SQLSTATE 07002

The relevant emailconfirm.cfm code is :

<cfparam name="URL.CustID" default="1">
<cfparam name="URL.Person_to_Email" default="1">
<cfparam name="FORM.Person_to_Email" default="1">


<cfquery name="ApartmentQuery" datasource="LeasingSolution_Big_DB">
SELECT * FROM Apartment_Communities_ProductionDB WHERE Cust_ID IN #FORM.CustID#
</cfquery>

<cfquery name="NameandEmail" datasource="LeasingSolution_Big_DB">
SELECT * FROM Potential_Customer_Table WHERE Cust_ID = #FORM.Person_to_Email_to#
</cfquery>

any Ideas?

Reply With Quote
  #4  
Old September 12th, 2004, 12:16 PM
brokerandy25 brokerandy25 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2004
Posts: 4 brokerandy25 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via AIM to brokerandy25
Quote:
Originally Posted by brokerandy25
I tried that and the error I got was:

Error Executing Database Query.
[Macromedia][SequeLink JDBC Driver][ODBC Socket][Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 1.

The error occurred in C:\CFusionMX\wwwroot\LeasingSolutionsInc\emailconfirm.cfm: line 7

5 :
6 : <cfquery name="ApartmentQuery" datasource="LeasingSolution_Big_DB">
7 : SELECT * FROM Apartment_Communities_ProductionDB WHERE Cust_ID IN (#CustID#)
8 : </cfquery>
9 : <cfquery name="NameandEmail" datasource="LeasingSolution_Big_DB">



--------------------------------------------------------------------------------

SQL SELECT * FROM Apartment_Communities_ProductionDB WHERE Cust_ID IN (1)
DATASOURCE LeasingSolution_Big_DB
VENDORERRORCODE -3010
SQLSTATE 07002

The relevant emailconfirm.cfm code is :

<cfparam name="URL.CustID" default="1">
<cfparam name="URL.Person_to_Email" default="1">
<cfparam name="FORM.Person_to_Email" default="1">


<cfquery name="ApartmentQuery" datasource="LeasingSolution_Big_DB">
SELECT * FROM Apartment_Communities_ProductionDB WHERE Cust_ID IN #FORM.CustID#
</cfquery>

<cfquery name="NameandEmail" datasource="LeasingSolution_Big_DB">
SELECT * FROM Potential_Customer_Table WHERE Cust_ID = #FORM.Person_to_Email_to#
</cfquery>

any Ideas?


If I add the () around the Form.CustID variable I get

Error Executing Database Query.
[Macromedia][SequeLink JDBC Driver][ODBC Socket][Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 1.

The error occurred in C:\CFusionMX\wwwroot\LeasingSolutionsInc\emailconfirm.cfm: line 7

5 :
6 : <cfquery name="ApartmentQuery" datasource="LeasingSolution_Big_DB">
7 : SELECT * FROM Apartment_Communities_ProductionDB WHERE Cust_ID IN (#FORM.CustID#)
8 : </cfquery>
9 : <cfquery name="NameandEmail" datasource="LeasingSolution_Big_DB">



--------------------------------------------------------------------------------

SQL SELECT * FROM Apartment_Communities_ProductionDB WHERE Cust_ID IN (60,62,59)
DATASOURCE LeasingSolution_Big_DB
VENDORERRORCODE -3010
SQLSTATE 07002

Please try the following:

Reply With Quote
  #5  
Old September 13th, 2004, 07:46 AM
kiteless kiteless is offline
Moderator
Dev Shed Expert (3500 - 3999 posts)
 
Join Date: Jun 2002
Location: Raleigh, NC
Posts: 3,689 kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Week 4 Days 16 h 33 m 51 sec
Reputation Power: 53
If customer ID is not a numeric field, you'll need to put single quotes around EACH of the elements in your IN clause. You can look into the listQualify() function or maybe listChangeDelims().
__________________
Ask if you have a question, but also help answer questions that you have knowledge of! Thanks, Brian.
How to Post a Question in the Forums

Reply With Quote
  #6  
Old September 14th, 2004, 07:27 AM
brokerandy25 brokerandy25 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2004
Posts: 4 brokerandy25 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via AIM to brokerandy25
Quote:
Originally Posted by kiteless
If customer ID is not a numeric field, you'll need to put single quotes around EACH of the elements in your IN clause. You can look into the listQualify() function or maybe listChangeDelims().


Thanks for the help kiteless- As it turns out my problem was not what I thought it was, it was the fact that I am a mental midget and I didn't have my custId variable passed properly.

thanks again though for your time

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreColdFusion Development > passing a list as a variable


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway
Stay green...Green IT