You should be able to copy the top query, replacing the = value with the
cfqueryparam straight into a cfquery.

<!----------------//------
andy matthews
web developer
certified advanced coldfusion programmer
ICGLink, Inc.
[EMAIL PROTECTED]
615.370.1530 x737
--------------//--------->

-----Original Message-----
From: Richard White [mailto:[EMAIL PROTECTED]
Sent: Wednesday, October 25, 2006 8:33 AM
To: CF-Talk
Subject: nested queries


hi, i am having problems working out how to execute a nested query in a
cfquery.

It works fine in mysql with the following sql statement:

SELECT staffTitle,staffFirstName,staffLastName FROM STAFF WHERE staffEmail =
(SELECT staffEmail FROM STUDENTS WHERE studentEmail = email);

however, i am not sure how to convert this into a cfquery. i have tried the
following but getting an error:

SELECT staffTitle, staffFirstName, staffLastName FROM STAFF WHERE staffEmail
= SELECT staffEmail FROM STUDENTS WHERE studentEmail = <cfqueryparam
value="[EMAIL PROTECTED]" cfsqltype="cf_sql_varchar">

i would appreciate some help on what i am doing wrong

thanks very much



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting,
up-to-date ColdFusion information by your peers, delivered to your door four 
times a year.
http://www.fusionauthority.com/quarterly

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:257986
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

Reply via email to