Invalid Data for Parameter but which one?
Hi, I received the following error within a query 'Invalid data value false exceeds maxlength setting 1.' I understand the error but I need to trace which parameter is having this issue as there are lots. Is there any way of getting coldfusion to tell me? Thanks, Richard ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:359025 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Query columns shifting
Hey guys Got at bit of a weird thing going on in my code... Sometimes when I make a certain query, the query will return from the DB without error, but when I try to use the query I find that the columns have shifted, so that in a column where I would expect a date there is now a string. Has this ever happened to any of you? ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:359026 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Invalid Data for Parameter but which one?
I received the following error within a query 'Invalid data value false exceeds maxlength setting 1.' I understand the error but I need to trace which parameter is having this issue as there are lots. Is there any way of getting coldfusion to tell me? No, I don't think so. You'll basically have to go through them one-by-one until you figure it out. CF doesn't really know anything other than what the database tells it. Dave Watts, CTO, Fig Leaf Software 1-202-527-9569 http://www.figleaf.com/ http://training.figleaf.com/ Fig Leaf Software is a Veteran-Owned Small Business (VOSB) on GSA Schedule, and provides the highest caliber vendor-authorized instruction at our training centers, online, or onsite. ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:359027 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Invalid Data for Parameter but which one?
Actually, the error is telling you exactly what is wrong. You are sending a string value of false to a field that only allows a maximum of 1 character. More than likely, you are trying to send a true/false value to a char(1) field. Try either converting your true/false value to 1/0. Also, I do believe that if you use cfqueryparam (which you should be already) and specify the sql type for the field is bit, it will properly convert your true/false values to 1/0 for you. On Tue, Jul 29, 2014 at 4:47 AM, Richard White rich...@re-base.net wrote: Hi, I received the following error within a query 'Invalid data value false exceeds maxlength setting 1.' I understand the error but I need to trace which parameter is having this issue as there are lots. Is there any way of getting coldfusion to tell me? Thanks, Richard ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:359028 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Invalid Data for Parameter but which one?
More than likely, you are trying to send a true/false value to a char(1) field. ... or even more likely to a boolean field. ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:359029 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Invalid Data for Parameter but which one?
CF only transmit what the database driver reports. Many drivers will report an error, but not which field caused the error, which is quite frustrating. Sometimes, one can have more details by copying the SQL statement and execute it in the database itself. ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:359030 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Query columns shifting
Got at bit of a weird thing going on in my code... Pretty hard to tell without seing that code... If you transfer the query result into a list and if there is one empty column, you might shift all the values after the empty valu indeed. ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:359031 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Query columns shifting
I've seen this before when the query was previously a SELECT * and modified to SELECT col1, col2, * ..., or is a SELECT * and the database schema is modified, or other similar scenario. Only way I remember resolving this was a CF restart. I think when SELECT * is used there is some sort of caching (on the CF side) of the column names and positions that occurs. Even changing the name attribute in the cfquery has no effect. I don't remember seeing this happening in CF 10, but pretty sure it was still happening in CF 9. For this and others, I always explicitly state the columns, and even more so use stored procedures over inline queries whenever possible. -- Regards, Byron Mann Lead Engineer Architect HostMySite On Tue, Jul 29, 2014 at 8:00 AM, Michael Christensen mich...@strib.dk wrote: Hey guys Got at bit of a weird thing going on in my code... Sometimes when I make a certain query, the query will return from the DB without error, but when I try to use the query I find that the columns have shifted, so that in a column where I would expect a date there is now a string. Has this ever happened to any of you? ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:359032 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
NEED cfcompile.bat
Somehow, my CF10 version of CFCOMPILE.BAT got wiped out [zero length file] (in Coldfusion10/cfusion/bin) would some kind sole send me a copy of the file to rcol...@cox.net. TNX!!! ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:359033 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: NEED cfcompile.bat
this is even stranger. when I run the compile command, it overwrites the compile.bat file and makes it zero length. this used to work: C:\Windows\System32c:\Coldfusion10\cfusion\bin\cfcompile.bat -deploy d:\inetpub \Actavalon\company d:\actavalon\secure_source d:\actavalon\secure_source_compiled what am I doing wrong, please. On 7/29/2014 1:44 PM, Richard Colman wrote: Somehow, my CF10 version of CFCOMPILE.BAT got wiped out [zero length file] (in Coldfusion10/cfusion/bin) would some kind sole send me a copy of the file to rcol...@cox.net. TNX!!! ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:359034 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: NEED cfcompile.bat
Then, on the third or fourth try, it executed??? On 7/29/2014 1:56 PM, Richard Colman wrote: this is even stranger. when I run the compile command, it overwrites the compile.bat file and makes it zero length. this used to work: C:\Windows\System32c:\Coldfusion10\cfusion\bin\cfcompile.bat -deploy d:\inetpub \Actavalon\company d:\actavalon\secure_source d:\actavalon\secure_source_compiled what am I doing wrong, please. On 7/29/2014 1:44 PM, Richard Colman wrote: Somehow, my CF10 version of CFCOMPILE.BAT got wiped out [zero length file] (in Coldfusion10/cfusion/bin) would some kind sole send me a copy of the file to rcol...@cox.net. TNX!!! ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:359035 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm