[thelist] ColdFusion query questions

Chris Johnston chris at fuzzylizard.com
Wed Dec 3 12:58:14 CST 2003


Kelly Hallman wrote:

>For instance, if I want to SELECT and see if there was any matching rows?  
>How do I loop/test them without outputting them? What if I did an INSERT
>that failed due to a table constraint, how do I test for that?
>  
>
As far as I know, if any sql query fails, for whatever reason, you get 
this wonderful and ugly CF error page telling what happened. At least, 
that is all that I have ever received from an error. There are ways of 
handling errors more gracefully though.

As for failing due to a constraint in the DB, I am not sure. As far as I 
know, there is no return value from the cfquery tag that you can check 
to ensure the query succeeded. (Could be wrong about that though).

chris



More information about the thelist mailing list