That is what I am noticing in my testing. If the value in the form field passed to the insert query does not match the criteria of the <cfqueryparam> (text instead of numbers for type of cf_sql_int or too much text where the maxlength is set) an "UNKNOWN" error type is thrown instead of an database error. If I don't use the <cfqueryParam> tags, just pass the data straight into the database I get database errors, with different native error codes for whether it's characters into a number field, ect.
This is kind of interesting. I guess, I will need to do something different. If I use query parameters, I can only catch type=Any. This may catch more errors then I want with this try/catch block. I'm not exactly sure how to filter out when it is an data input error and when it is some other kind of error. I'll probably validate the form control values before passing it to the database. I was hopping to let cold fusion/my database do some of that work for me. Ian Skinner Blood Source Web Developer -----Original Message----- From: Lofback, Chris [mailto:[EMAIL PROTECTED]] Sent: Wednesday, January 08, 2003 10:08 AM To: CF-Talk Subject: RE: CFQueryParam and Error Handling I also get error type "UNKNOWN" using CF5 on Win2K. I guess you have to CFCATCH it using TYPE="Any". Chris Lofback Sr. Web Developer TRX Integration 28051 US 19 N., Ste. C Clearwater, FL 33761 www.trxi.com > -----Original Message----- > From: Ian Skinner [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, January 08, 2003 12:32 PM > To: CF-Talk > Subject: RE: CFQueryParam and Error Handling > > > Ok...I'm going to try type "Database" again. That's was my > first thought, > but it didn't seem to be working. That I was getting error's > that weren't > of type "Database"..and when I dump the errors, CFCatch.ErrorType is > "Unknown". > > Ian > > > -----Original Message----- > From: Mark A. Kruger - CFG [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, January 08, 2003 9:23 AM > To: CF-Talk > Subject: RE: CFQueryParam and Error Handling > > > Ian, > > The <cfqueryparam> tag will throw errors of type "Database" > when any values > that are not of the correct type are passed into it. This > actually works > pretty much the same as when you are not using the tag. For example, > passing an int (like 50) to a character field using the > "char" type will > work - naturally. Passing a non numeric character string to a > numeric field > will not work etc. <cfqueryparam> does not cause huge changes to error > trapping. > > -Mark. > > -----Original Message----- > From: Ian Skinner [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, January 08, 2003 10:59 AM > To: CF-Talk > Subject: CFQueryParam and Error Handling > > > I'm trying to step up my coding standards and start using > <cfqueryparam>'s > in my Database calls. What I would like to know is how I should catch > error's thrown by improper data passed to the queryparam? > I've scanned > through the <cftry><cfcatch> and the <cferror> documentation, > but I'm not > readily understanding how to use either one to catch error's > in data passed > to a <cfqueryparam> and provide logic to handle it. > > Thanks > Ian Skinner > Web Developer > Blood Source > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

