Whats wrong with this SQL?

2009-10-03 Thread Glyn Jackson

Any reason why below does now work? no errors it just does not do what it 
states.
it should look at all valueId's in the database and if its not in the list 
delete it, simple, right, so why does it not work?

DELETE FROM options 
WHERE valueId NOT IN  
cfqueryparam value=#arguments.list# cfsqltype=cf_sql_varchar / 

PS I dont have the option of using a stored procedure so it must be done at the 
layer above 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:326876
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: Whats wrong with this SQL?

2009-10-03 Thread Glyn Jackson

PS the list looks like...

1,2,3,4,5,6 etc 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:326877
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: Whats wrong with this SQL?

2009-10-03 Thread Leigh

 PS the list looks like...
 
 1,2,3,4,5,6 etc 

(I do not know if this went through)

It looks like you forgot the parenthesis and list attribute of cfqueryparam:

WHERE valueId NOT IN 
(
cfqueryparam value=#arguments.list#
cfsqltype=cf_sql_varchar
list=true
/
)




  


~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:326878
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: Whats wrong with this SQL?

2009-10-03 Thread Glyn Jackson

simple when you know how. Thank you! 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:326879
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4