RE: division by 0 error
Is there an include in Application.cfm that has a bit of code on ITS line 7 that might cause it? ..:.:.:.:.:.:.:.:.:.:.:. Bobby Hartsfield http://acoderslife.com -Original Message- From: Russ [mailto:[EMAIL PROTECTED] Sent: Friday, December 01, 2006 10:52 AM To: CF-Talk Subject: division by 0 error I'm having weird intermittend division by 0 errors that I think might be related to multiple instances. The crash supposedly happens on application.cfm line 7, which is just your basic cfapplication tag. / by zero The error occurred in W:\rise\cf\www\Application.cfm: line 7 5 : clientmanagement=Yes 6 : sessionmanagement=Yes 7 : setclientcookies=Yes 8 : sessiontimeout=#CreateTimeSpan(0,2,0,0)# 9 : clientstorage=myClientDSN Does anyone have any ideas of what might be causing this? Would setting up seefusion or fusionreactor help debugging this? Basically it works fine until I log in and log out several times. Then once it hits the error, it stays with it. no matter what page I go to. Russ ~| 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:262432 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
RE: division by 0 error
Nope... no includes. From the strack trace it looks like it has something to do with J2EE sessions. The error also seems to only happen when more then 1 instance is running, so perhaps something with session replication? I set up the cluster using cf admin, could that be a problem? Should I be using J2EE admin instead? Here is the stack trace: java.lang.ArithmeticException: / by zero at coldfusion.util.FastHashtable.find(FastHashtable.java:77) at coldfusion.util.FastHashtable.put(FastHashtable.java:180) at coldfusion.runtime.J2eeSessionScope.bind(J2eeSessionScope.java:51) at coldfusion.runtime.AbstractScope.bindName(AbstractScope.java:50) at coldfusion.runtime.Scope.put(Scope.java:67) at coldfusion.runtime.J2eeSessionScope.put(J2eeSessionScope.java:70) at coldfusion.runtime.AppHelper.setupJ2eeSessionScope(AppHelper.java:552) at coldfusion.runtime.AppHelper.setupSessionScope(AppHelper.java:602) at coldfusion.tagext.lang.ApplicationTag.doStartTag(ApplicationTag.java:248) at coldfusion.runtime.CfJspPage._emptyTag(CfJspPage.java:1915) at cfApplication2ecfm2142783449.runPage(W:\rise\cf\www\Application.cfm:7) at coldfusion.runtime.CfJspPage.invoke(CfJspPage.java:152) at coldfusion.tagext.lang.IncludeTag.doStartTag(IncludeTag.java:349) at coldfusion.filter.CfincludeFilter.invoke(CfincludeFilter.java:65) at coldfusion.filter.CfincludeFilter.include(CfincludeFilter.java:33) at coldfusion.filter.ApplicationFilter.invoke(ApplicationFilter.java:172) at coldfusion.filter.RequestMonitorFilter.invoke(RequestMonitorFilter.java:51) at coldfusion.filter.PathFilter.invoke(PathFilter.java:86) at coldfusion.filter.ExceptionFilter.invoke(ExceptionFilter.java:69) at coldfusion.filter.BrowserDebugFilter.invoke(BrowserDebugFilter.java:52) at coldfusion.filter.ClientScopePersistenceFilter.invoke(ClientScopePersistence Filter.java:28) at coldfusion.filter.BrowserFilter.invoke(BrowserFilter.java:38) at coldfusion.filter.GlobalsFilter.invoke(GlobalsFilter.java:38) at coldfusion.filter.DatasourceFilter.invoke(DatasourceFilter.java:22) at coldfusion.filter.RequestThrottleFilter.invoke(RequestThrottleFilter.java:11 5) at coldfusion.CfmServlet.service(CfmServlet.java:107) at coldfusion.bootstrap.BootstrapServlet.service(BootstrapServlet.java:78) at jrun.servlet.FilterChain.doFilter(FilterChain.java:86) at net.teleologic.server.filters.ProxyRemoteHostFilter.doFilter(ProxyRemoteHost Filter.java:69) at jrun.servlet.FilterChain.doFilter(FilterChain.java:94) at jrun.servlet.FilterChain.service(FilterChain.java:101) at jrun.servlet.ServletInvoker.invoke(ServletInvoker.java:91) at jrun.servlet.JRunInvokerChain.invokeNext(JRunInvokerChain.java:42) at jrun.servlet.JRunRequestDispatcher.invoke(JRunRequestDispatcher.java:257) at jrun.servlet.ServletEngineService.dispatch(ServletEngineService.java:541) at jrun.servlet.jrpp.JRunProxyService.invokeRunnable(JRunProxyService.java:204) at jrunx.scheduler.ThreadPool$ThreadThrottle.invokeRunnable(ThreadPool.java:426 ) at jrunx.scheduler.WorkerThread.run(WorkerThread.java:66) And here is find method from FastHashTable.java (although mangled a bit by the decompilation) protected synchronized int find(Object key) { String sKey = key.toString(); int hash = HashcodeCache.noCaseHashCode(sKey); int code = (hash 0x7fff) % keys.length; int attempts = 0; for(int maxAttempts = keys.length; attempts++ maxAttempts;) { Object k = keys[code]; if(k == null || !REMOVED.equals(k) (k == key || sKey.equalsIgnoreCase(k.toString( return code; hash = code 1 ^ attempts ^ hash; code = (hash 0x7fff) % keys.length; } while(attempts-- 0) { Object k = keys[code]; if(k == null || !REMOVED.equals(k) (k == key || sKey.equalsIgnoreCase(k.toString( return code; code = (code + 1) % keys.length; } throw new IllegalStateException(); } -Original Message- From: Bobby Hartsfield [mailto:[EMAIL PROTECTED] Sent: Friday, December 01, 2006 11:04 AM To: CF-Talk Subject: RE: division by 0 error Is there an include in Application.cfm that has a bit of code on ITS line 7 that might cause it? ..:.:.:.:.:.:.:.:.:.:.:. Bobby Hartsfield http://acoderslife.com -Original Message- From: Russ [mailto:[EMAIL PROTECTED] Sent: Friday, December 01, 2006 10:52 AM To: CF-Talk Subject: division by 0 error I'm having weird intermittend division by 0 errors that I think might be related to multiple instances. The crash supposedly happens on application.cfm line 7, which
RE: division by 0 error
Sorry. I'm lost in stack traces. Wish I could help more. ..:.:.:.:.:.:.:.:.:.:.:. Bobby Hartsfield http://acoderslife.com -Original Message- From: Russ [mailto:[EMAIL PROTECTED] Sent: Friday, December 01, 2006 11:44 AM To: CF-Talk Subject: RE: division by 0 error Nope... no includes. From the strack trace it looks like it has something to do with J2EE sessions. The error also seems to only happen when more then 1 instance is running, so perhaps something with session replication? I set up the cluster using cf admin, could that be a problem? Should I be using J2EE admin instead? Here is the stack trace: java.lang.ArithmeticException: / by zero at coldfusion.util.FastHashtable.find(FastHashtable.java:77) at coldfusion.util.FastHashtable.put(FastHashtable.java:180) at coldfusion.runtime.J2eeSessionScope.bind(J2eeSessionScope.java:51) at coldfusion.runtime.AbstractScope.bindName(AbstractScope.java:50) at coldfusion.runtime.Scope.put(Scope.java:67) at coldfusion.runtime.J2eeSessionScope.put(J2eeSessionScope.java:70) at coldfusion.runtime.AppHelper.setupJ2eeSessionScope(AppHelper.java:552) at coldfusion.runtime.AppHelper.setupSessionScope(AppHelper.java:602) at coldfusion.tagext.lang.ApplicationTag.doStartTag(ApplicationTag.java:248) at coldfusion.runtime.CfJspPage._emptyTag(CfJspPage.java:1915) at cfApplication2ecfm2142783449.runPage(W:\rise\cf\www\Application.cfm:7) at coldfusion.runtime.CfJspPage.invoke(CfJspPage.java:152) at coldfusion.tagext.lang.IncludeTag.doStartTag(IncludeTag.java:349) at coldfusion.filter.CfincludeFilter.invoke(CfincludeFilter.java:65) at coldfusion.filter.CfincludeFilter.include(CfincludeFilter.java:33) at coldfusion.filter.ApplicationFilter.invoke(ApplicationFilter.java:172) at coldfusion.filter.RequestMonitorFilter.invoke(RequestMonitorFilter.java:51) at coldfusion.filter.PathFilter.invoke(PathFilter.java:86) at coldfusion.filter.ExceptionFilter.invoke(ExceptionFilter.java:69) at coldfusion.filter.BrowserDebugFilter.invoke(BrowserDebugFilter.java:52) at coldfusion.filter.ClientScopePersistenceFilter.invoke(ClientScopePersistence Filter.java:28) at coldfusion.filter.BrowserFilter.invoke(BrowserFilter.java:38) at coldfusion.filter.GlobalsFilter.invoke(GlobalsFilter.java:38) at coldfusion.filter.DatasourceFilter.invoke(DatasourceFilter.java:22) at coldfusion.filter.RequestThrottleFilter.invoke(RequestThrottleFilter.java:11 5) at coldfusion.CfmServlet.service(CfmServlet.java:107) at coldfusion.bootstrap.BootstrapServlet.service(BootstrapServlet.java:78) at jrun.servlet.FilterChain.doFilter(FilterChain.java:86) at net.teleologic.server.filters.ProxyRemoteHostFilter.doFilter(ProxyRemoteHost Filter.java:69) at jrun.servlet.FilterChain.doFilter(FilterChain.java:94) at jrun.servlet.FilterChain.service(FilterChain.java:101) at jrun.servlet.ServletInvoker.invoke(ServletInvoker.java:91) at jrun.servlet.JRunInvokerChain.invokeNext(JRunInvokerChain.java:42) at jrun.servlet.JRunRequestDispatcher.invoke(JRunRequestDispatcher.java:257) at jrun.servlet.ServletEngineService.dispatch(ServletEngineService.java:541) at jrun.servlet.jrpp.JRunProxyService.invokeRunnable(JRunProxyService.java:204) at jrunx.scheduler.ThreadPool$ThreadThrottle.invokeRunnable(ThreadPool.java:426 ) at jrunx.scheduler.WorkerThread.run(WorkerThread.java:66) And here is find method from FastHashTable.java (although mangled a bit by the decompilation) protected synchronized int find(Object key) { String sKey = key.toString(); int hash = HashcodeCache.noCaseHashCode(sKey); int code = (hash 0x7fff) % keys.length; int attempts = 0; for(int maxAttempts = keys.length; attempts++ maxAttempts;) { Object k = keys[code]; if(k == null || !REMOVED.equals(k) (k == key || sKey.equalsIgnoreCase(k.toString( return code; hash = code 1 ^ attempts ^ hash; code = (hash 0x7fff) % keys.length; } while(attempts-- 0) { Object k = keys[code]; if(k == null || !REMOVED.equals(k) (k == key || sKey.equalsIgnoreCase(k.toString( return code; code = (code + 1) % keys.length; } throw new IllegalStateException(); } -Original Message- From: Bobby Hartsfield [mailto:[EMAIL PROTECTED] Sent: Friday, December 01, 2006 11:04 AM To: CF-Talk Subject: RE: division by 0 error Is there an include in Application.cfm that has a bit of code on ITS line 7 that might cause it? ..:.:.:.:.:.:.:.:.:.:.:. Bobby Hartsfield http://acoderslife.com -Original Message- From: Russ
Re: division by 0 error
We've been seeing a bit of these too. On login to apps and apps where no math is performed. We also have multiple instances.. I haven't seen much around the web as far as answers though On 12/1/06, Bobby Hartsfield [EMAIL PROTECTED] wrote: Sorry. I'm lost in stack traces. Wish I could help more. ..:.:.:.:.:.:.:.:.:.:.:. Bobby Hartsfield http://acoderslife.com -Original Message- From: Russ [mailto:[EMAIL PROTECTED] Sent: Friday, December 01, 2006 11:44 AM To: CF-Talk Subject: RE: division by 0 error Nope... no includes. From the strack trace it looks like it has something to do with J2EE sessions. The error also seems to only happen when more then 1 instance is running, so perhaps something with session replication? I set up the cluster using cf admin, could that be a problem? Should I be using J2EE admin instead? Here is the stack trace: java.lang.ArithmeticException: / by zero at coldfusion.util.FastHashtable.find(FastHashtable.java:77) at coldfusion.util.FastHashtable.put(FastHashtable.java:180) at coldfusion.runtime.J2eeSessionScope.bind(J2eeSessionScope.java:51) at coldfusion.runtime.AbstractScope.bindName(AbstractScope.java:50) at coldfusion.runtime.Scope.put(Scope.java:67) at coldfusion.runtime.J2eeSessionScope.put(J2eeSessionScope.java:70) at coldfusion.runtime.AppHelper.setupJ2eeSessionScope(AppHelper.java:552) at coldfusion.runtime.AppHelper.setupSessionScope(AppHelper.java:602) at coldfusion.tagext.lang.ApplicationTag.doStartTag(ApplicationTag.java:248) at coldfusion.runtime.CfJspPage._emptyTag(CfJspPage.java:1915) at cfApplication2ecfm2142783449.runPage(W:\rise\cf\www\Application.cfm:7) at coldfusion.runtime.CfJspPage.invoke(CfJspPage.java:152) at coldfusion.tagext.lang.IncludeTag.doStartTag(IncludeTag.java:349) at coldfusion.filter.CfincludeFilter.invoke(CfincludeFilter.java:65) at coldfusion.filter.CfincludeFilter.include(CfincludeFilter.java:33) at coldfusion.filter.ApplicationFilter.invoke(ApplicationFilter.java:172) at coldfusion.filter.RequestMonitorFilter.invoke(RequestMonitorFilter.java:51) at coldfusion.filter.PathFilter.invoke(PathFilter.java:86) at coldfusion.filter.ExceptionFilter.invoke(ExceptionFilter.java:69) at coldfusion.filter.BrowserDebugFilter.invoke(BrowserDebugFilter.java:52) at coldfusion.filter.ClientScopePersistenceFilter.invoke(ClientScopePersistence Filter.java:28) at coldfusion.filter.BrowserFilter.invoke(BrowserFilter.java:38) at coldfusion.filter.GlobalsFilter.invoke(GlobalsFilter.java:38) at coldfusion.filter.DatasourceFilter.invoke(DatasourceFilter.java:22) at coldfusion.filter.RequestThrottleFilter.invoke(RequestThrottleFilter.java:11 5) at coldfusion.CfmServlet.service(CfmServlet.java:107) at coldfusion.bootstrap.BootstrapServlet.service(BootstrapServlet.java:78) at jrun.servlet.FilterChain.doFilter(FilterChain.java:86) at net.teleologic.server.filters.ProxyRemoteHostFilter.doFilter(ProxyRemoteHost Filter.java:69) at jrun.servlet.FilterChain.doFilter(FilterChain.java:94) at jrun.servlet.FilterChain.service(FilterChain.java:101) at jrun.servlet.ServletInvoker.invoke(ServletInvoker.java:91) at jrun.servlet.JRunInvokerChain.invokeNext(JRunInvokerChain.java:42) at jrun.servlet.JRunRequestDispatcher.invoke(JRunRequestDispatcher.java:257) at jrun.servlet.ServletEngineService.dispatch(ServletEngineService.java:541) at jrun.servlet.jrpp.JRunProxyService.invokeRunnable(JRunProxyService.java:204) at jrunx.scheduler.ThreadPool$ThreadThrottle.invokeRunnable(ThreadPool.java:426 ) at jrunx.scheduler.WorkerThread.run(WorkerThread.java:66) And here is find method from FastHashTable.java (although mangled a bit by the decompilation) protected synchronized int find(Object key) { String sKey = key.toString(); int hash = HashcodeCache.noCaseHashCode(sKey); int code = (hash 0x7fff) % keys.length; int attempts = 0; for(int maxAttempts = keys.length; attempts++ maxAttempts;) { Object k = keys[code]; if(k == null || !REMOVED.equals(k) (k == key || sKey.equalsIgnoreCase(k.toString( return code; hash = code 1 ^ attempts ^ hash; code = (hash 0x7fff) % keys.length; } while(attempts-- 0) { Object k = keys[code]; if(k == null || !REMOVED.equals(k) (k == key || sKey.equalsIgnoreCase(k.toString( return code; code = (code + 1) % keys.length; } throw new IllegalStateException(); } -Original Message- From: Bobby Hartsfield
RE: division by 0 error
From the strack trace it looks like it has something to do with J2EE sessions. The error also seems to only happen when more then 1 instance is running, so perhaps something with session replication? I set up the cluster using cf admin, could that be a problem? Should I be using J2EE admin instead? Here is the stack trace: java.lang.ArithmeticException: / by zero at coldfusion.util.FastHashtable.find(FastHashtable.java:77) at coldfusion.util.FastHashtable.put(FastHashtable.java:180) at coldfusion.runtime.J2eeSessionScope.bind(J2eeSessionScope.java:51) ... Does it happen if you disable one instance? Are you storing any CFC instances in the Session scope? Are the instances on different servers? If so, you will probably need to use SETDOMAINCOOKIES in your CFAPPLICATION tag. Is there a reason why you're also using Client variables? If you put a little code in Application.cfm prior to your CFAPPLICATION tag to identify each instance, do the failures always occur on the same instance? The code is available here: http://www.sumoc.com/blog/index.cfm?mode=entryentry=7B541DBA-5004-2066-B7BC F2D895B3EC4A Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ Fig Leaf Software provides the highest caliber vendor-authorized instruction at our training centers in Washington DC, Atlanta, Chicago, Baltimore, Northern Virginia, or on-site at your location. Visit http://training.figleaf.com/ for more information! ~| 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:262463 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: division by 0 error
-Original Message- From: Dave Watts [mailto:[EMAIL PROTECTED] Sent: Friday, December 01, 2006 12:54 PM To: CF-Talk Subject: RE: division by 0 error From the strack trace it looks like it has something to do with J2EE sessions. The error also seems to only happen when more then 1 instance is running, so perhaps something with session replication? I set up the cluster using cf admin, could that be a problem? Should I be using J2EE admin instead? Here is the stack trace: java.lang.ArithmeticException: / by zero at coldfusion.util.FastHashtable.find(FastHashtable.java:77) at coldfusion.util.FastHashtable.put(FastHashtable.java:180) at coldfusion.runtime.J2eeSessionScope.bind(J2eeSessionScope.java:51) ... Does it happen if you disable one instance? Are you storing any CFC instances in the Session scope? Are the instances on different servers? If so, you will probably need to use SETDOMAINCOOKIES in your CFAPPLICATION tag. Is there a reason why you're also using Client variables? If you put a little code in Application.cfm prior to your CFAPPLICATION tag to identify each instance, do the failures always occur on the same instance? The code is available here: http://www.sumoc.com/blog/index.cfm?mode=entryentry=7B541DBA-5004-2066- B7BC F2D895B3EC4A If I only use 1 instance, everything is fine. Once I have more then 1 instance in the cluster, the error happens randomly. I'm not sure the exact reason we're using client variables. It's a big system and I haven't played with that part of the code yet. In my test example the instances are both on the same server. I put in the code and it's not always the same instance that the error occurs in. Also once the error occurs, it will happen on any instance, and on any page that I try to access until I clear my cookies (i.e. get a new session). ~| 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:262473 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: division by 0 error
If I only use 1 instance, everything is fine. Once I have more then 1 instance in the cluster, the error happens randomly. I'm not sure the exact reason we're using client variables. It's a big system and I haven't played with that part of the code yet. In my test example the instances are both on the same server. I put in the code and it's not always the same instance that the error occurs in. Also once the error occurs, it will happen on any instance, and on any page that I try to access until I clear my cookies (i.e. get a new session). But the error doesn't happen right away, right? Can you trap what's in the Session scope prior to the error? Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ Fig Leaf Software provides the highest caliber vendor-authorized instruction at our training centers in Washington DC, Atlanta, Chicago, Baltimore, Northern Virginia, or on-site at your location. Visit http://training.figleaf.com/ for more information! ~| 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:262479 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
RE: division by 0 error
But the error doesn't happen right away, right? Can you trap what's in the Session scope prior to the error? The session scope wouldn't exist before the cfapplication tag, would it?? ~Brad ~| 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:262480 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: division by 0 error
I'm not sure how... The error doesn't always happen on the same action. Further complicating things is the fact that this error only happens on production. I can't seem to replicate it on our development server. Russ -Original Message- From: Dave Watts [mailto:[EMAIL PROTECTED] Sent: Friday, December 01, 2006 1:31 PM To: CF-Talk Subject: RE: division by 0 error If I only use 1 instance, everything is fine. Once I have more then 1 instance in the cluster, the error happens randomly. I'm not sure the exact reason we're using client variables. It's a big system and I haven't played with that part of the code yet. In my test example the instances are both on the same server. I put in the code and it's not always the same instance that the error occurs in. Also once the error occurs, it will happen on any instance, and on any page that I try to access until I clear my cookies (i.e. get a new session). But the error doesn't happen right away, right? Can you trap what's in the Session scope prior to the error? Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ Fig Leaf Software provides the highest caliber vendor-authorized instruction at our training centers in Washington DC, Atlanta, Chicago, Baltimore, Northern Virginia, or on-site at your location. Visit http://training.figleaf.com/ for more information! ~| 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:262481 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
RE: division by 0 error
I'm not sure how... The error doesn't always happen on the same action. Use onRequestEnd/onRequestEnd.cfm to log your session data? Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ Fig Leaf Software provides the highest caliber vendor-authorized instruction at our training centers in Washington DC, Atlanta, Chicago, Baltimore, Northern Virginia, or on-site at your location. Visit http://training.figleaf.com/ for more information! ~| 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:262484 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
RE: division by 0 error
I found a workaround. Basically I put cfapplication in a try catch block, and if it fails, I force the jsessionid cookie to expire and redirect them to the homepage. Seems to do the trick... I dumped the session before it broke, but don't see anything weird... Russ -Original Message- From: Dave Watts [mailto:[EMAIL PROTECTED] Sent: Friday, December 01, 2006 1:51 PM To: CF-Talk Subject: RE: division by 0 error I'm not sure how... The error doesn't always happen on the same action. Use onRequestEnd/onRequestEnd.cfm to log your session data? Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ Fig Leaf Software provides the highest caliber vendor-authorized instruction at our training centers in Washington DC, Atlanta, Chicago, Baltimore, Northern Virginia, or on-site at your location. Visit http://training.figleaf.com/ for more information! ~| 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:262486 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
RE: division by 0 error
This is what I'm using as a workaround cftry cfapplication name=myapp clientmanagement=Yes sessionmanagement=Yes setclientcookies=No sessiontimeout=#CreateTimeSpan(0,2,0,0)# clientstorage=myclientdsn cfcatch type=java.lang.ArithmeticExceptioncfif isDefined(session)cfdump var=#session#cfelsecfoutputsession is not defined #cookie.jsessionId# cfcookie name=jsessionId value= expires=#Now()#cflocation url=http://#cgi.server_name#; addtoken=no/cfoutput/cfif/cfcatch /cftry Is there a better way? Perhaps something that will preserve the form post? Russ -Original Message- From: Russ [mailto:[EMAIL PROTECTED] Sent: Friday, December 01, 2006 2:10 PM To: CF-Talk Subject: RE: division by 0 error I found a workaround. Basically I put cfapplication in a try catch block, and if it fails, I force the jsessionid cookie to expire and redirect them to the homepage. Seems to do the trick... I dumped the session before it broke, but don't see anything weird... Russ -Original Message- From: Dave Watts [mailto:[EMAIL PROTECTED] Sent: Friday, December 01, 2006 1:51 PM To: CF-Talk Subject: RE: division by 0 error I'm not sure how... The error doesn't always happen on the same action. Use onRequestEnd/onRequestEnd.cfm to log your session data? Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ Fig Leaf Software provides the highest caliber vendor-authorized instruction at our training centers in Washington DC, Atlanta, Chicago, Baltimore, Northern Virginia, or on-site at your location. Visit http://training.figleaf.com/ for more information! ~| 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:262487 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
RE: division
It turned it into "1" because in CF the "backwards" slash is the integer division operator. (very confusing imho -- why not use DIV as some other languages do?) I've asked my programmers to ALWAYS comment their code when using this operator to prevent future confusion factors. -Original Message- From: Cornillon, Matthieu [mailto:[EMAIL PROTECTED]] Sent: Wednesday, December 13, 2000 12:46 PM To: CF-Talk Subject: RE: division Rick, The division operator in your first line of code is the wrong slash. I'm not sure why, but CF apparently turns that whole thing into "1". Strange. I reproduced the same problem on my end. Flipping that slash fixes it. Matthieu -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Wednesday, December 13, 2000 12:02 PM To: CF-Talk Subject: division This was suppose to be easy... I'm trying to divide a recordcount by 100 and then round up. Currently my recordcount is 162 and i'm using the ceiling function to round up but it keeps giving me 1. I've tried using number format and decimal format with no luck. Any suggestions? Code below: cfset temp = decimalFormat(getdealers.recordcount\100) cfset variables.totalpages = ceiling(temp) Thanks, Rick ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: division
You're using the wrong division symbol! / returns a regular division \ returns the integer result of a regular division, that means ... no decimals! Allan Pichler Machine Dreams Inc. -Original Message- From: Rick Lamb [mailto:[EMAIL PROTECTED]] Sent: Wednesday, December 13, 2000 9:02 AM To: CF-Talk Subject: division This was suppose to be easy... I'm trying to divide a recordcount by 100 and then round up. Currently my recordcount is 162 and i'm using the ceiling function to round up but it keeps giving me 1. I've tried using number format and decimal format with no luck. Any suggestions? Code below: cfset temp = decimalFormat(getdealers.recordcount\100) cfset variables.totalpages = ceiling(temp) Thanks, Rick ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
Re: division
Try using cfset temp = decimalFormat(getdealers.recordcount/100) Sincirely Tom Espen Pedersen developer www.pixelduck.com - Original Message - From: "Rick Lamb" [EMAIL PROTECTED] To: "CF-Talk" [EMAIL PROTECTED] Sent: Wednesday, December 13, 2000 6:02 PM Subject: division This was suppose to be easy... I'm trying to divide a recordcount by 100 and then round up. Currently my recordcount is 162 and i'm using the ceiling function to round up but it keeps giving me 1. I've tried using number format and decimal format with no luck. Any suggestions? Code below: cfset temp = decimalFormat(getdealers.recordcount\100) cfset variables.totalpages = ceiling(temp) Thanks, Rick ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: division
CFSET varname = #Round(getdealers.recordcount/100)# or CFSET varname = #Round(Evaluate(getdealers.recordcount/100))# should work fine. -Original Message- From: Rick Lamb [mailto:[EMAIL PROTECTED]] Sent: Wednesday, December 13, 2000 9:02 AM To: CF-Talk Subject: division This was suppose to be easy... I'm trying to divide a recordcount by 100 and then round up. Currently my recordcount is 162 and i'm using the ceiling function to round up but it keeps giving me 1. I've tried using number format and decimal format with no luck. Any suggestions? Code below: cfset temp = decimalFormat(getdealers.recordcount\100) cfset variables.totalpages = ceiling(temp) Thanks, Rick ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: division
Rick, The division operator in your first line of code is the wrong slash. I'm not sure why, but CF apparently turns that whole thing into "1". Strange. I reproduced the same problem on my end. Flipping that slash fixes it. Matthieu -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Wednesday, December 13, 2000 12:02 PM To: CF-Talk Subject: division This was suppose to be easy... I'm trying to divide a recordcount by 100 and then round up. Currently my recordcount is 162 and i'm using the ceiling function to round up but it keeps giving me 1. I've tried using number format and decimal format with no luck. Any suggestions? Code below: cfset temp = decimalFormat(getdealers.recordcount\100) cfset variables.totalpages = ceiling(temp) Thanks, Rick ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: division
Ok. I'm a dumb @#$!. I just needed to point my slash the right way, /, not \. HeHe! So when you guys get this in 2 hours or so, excuse my thickness. Rick -Original Message- From: Rick Lamb [mailto:[EMAIL PROTECTED]] Sent: Wednesday, December 13, 2000 11:02 AM To: CF-Talk Subject: division This was suppose to be easy... I'm trying to divide a recordcount by 100 and then round up. Currently my recordcount is 162 and i'm using the ceiling function to round up but it keeps giving me 1. I've tried using number format and decimal format with no luck. Any suggestions? Code below: cfset temp = decimalFormat(getdealers.recordcount\100) cfset variables.totalpages = ceiling(temp) Thanks, Rick ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
Re: division
Try this: cfset temp = getdealers.recordcount * 0.01 cfset variables.totalpages = ceiling(temp) "/" strips the decimal part stas - Original Message - From: "Rick Lamb" [EMAIL PROTECTED] This was suppose to be easy... I'm trying to divide a recordcount by 100 and then round up. Currently my recordcount is 162 and i'm using the ceiling function to round up but it keeps giving me 1. I've tried using number format and decimal format with no luck. Any suggestions? Code below: cfset temp = decimalFormat(getdealers.recordcount\100) cfset variables.totalpages = ceiling(temp) Thanks, Rick ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: division
Honestly, I can't imagine what it might mean outside Australia, but down here it's very bad manners to "point your slash" the wrong way (and very messy). (Sorry about that) Lee (Bjork) Borkman http://bjork.net ColdFusion Tags by Bjork -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Ok. I'm a dumb @#$!. I just needed to point my slash the right way, /, not \. HeHe! So when you guys get this in 2 hours or so, excuse my thickness. Rick IMPORTANT NOTICE: This e-mail and any attachment to it is intended only to be read or used by the named addressee. It is confidential and may contain legally privileged information. No confidentiality or privilege is waived or lost by any mistaken transmission to you. If you receive this e-mail in error, please immediately delete it from your system and notify the sender. You must not disclose, copy or use any part of this e-mail if you are not the intended recipient. The RTA is not responsible for any unauthorised alterations to this e-mail or attachment to it. ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: division
Hey, are my messages getting through to you? I have my doubts. -Original Message- From: BORKMAN Lee Honestly, I can't imagine what it might mean outside Australia, but down here it's very bad manners to "point your slash" the wrong way (and very messy). (Sorry about that) Lee (Bjork) Borkman http://bjork.net ColdFusion Tags by Bjork -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Ok. I'm a dumb @#$!. I just needed to point my slash the right way, /, not \. HeHe! So when you guys get this in 2 hours or so, excuse my thickness. Rick IMPORTANT NOTICE: This e-mail and any attachment to it is intended only to be read or used by the named addressee. It is confidential and may contain legally privileged information. No confidentiality or privilege is waived or lost by any mistaken transmission to you. If you receive this e-mail in error, please immediately delete it from your system and notify the sender. You must not disclose, copy or use any part of this e-mail if you are not the intended recipient. The RTA is not responsible for any unauthorised alterations to this e-mail or attachment to it. ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
Re: division by zero error?
FYI, I just noticed that there are quotes around some of the numeric fields. I changed this in my app, and I'm still getting the error... (I inherited this app from someone else, so I'm still cleaning some of it up)... Original Message Follows From: "Terri Stocke" [EMAIL PROTECTED] Reply-To: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: division by zero error? Date: Fri, 15 Sep 2000 16:39:52 GMT Can anyone tell me what may be causing this error? Error Diagnostic Information ODBC Error Code = 22012 (Division by zero) [Microsoft][ODBC Microsoft Access 97 Driver]Division by zero (null) I am not performing any mathematical operations, nor do I have anything in my CF code that would cause CF to think that that is what I am trying to do. This is really a very simple two-page app. I have also tested this by NOT utilizing the phone and fax fields, with the same result. Here's the query (with their respective data types in brackets): CFQUERY name="SaveReq" datasource="TrainReg" INSERT INTO Request (ClassID, Request_Date, [datetime] Student_Name, [text] Student_Location, [text] Student_Department, [number] Student_Phone, [number] Student_Fax, [number] Manager_Name, [text] SendTo_Email) [text] VALUES (#Form.ClassID#, #dateformat(Now(), 'mm/dd/yy')#, '#Variables.StudentName#', '#Variables.StudentLoc#', #Form.DeptNo#, '#variables.studentphone#', '#variables.studentfax#', '#form.managername#', '#form.m_ta_email#') /cfquery _ Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com. Share information about yourself, create your own public profile at http://profiles.msn.com. -- Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body. _ Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com. Share information about yourself, create your own public profile at http://profiles.msn.com. -- Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body.
RE: division by zero error?
I believe it is in your dateformat, but I could be wrong. Try using full "" instead of '' around the formating. or use use CreateODBCDate(now()) Shane -Original Message- From: Terri Stocke [mailto:[EMAIL PROTECTED]] Sent: Friday, September 15, 2000 10:40 AM To: [EMAIL PROTECTED] Subject: division by zero error? Can anyone tell me what may be causing this error? Error Diagnostic Information ODBC Error Code = 22012 (Division by zero) [Microsoft][ODBC Microsoft Access 97 Driver]Division by zero (null) I am not performing any mathematical operations, nor do I have anything in my CF code that would cause CF to think that that is what I am trying to do. This is really a very simple two-page app. I have also tested this by NOT utilizing the phone and fax fields, with the same result. Here's the query (with their respective data types in brackets): CFQUERY name="SaveReq" datasource="TrainReg" INSERT INTO Request (ClassID, Request_Date, [datetime] Student_Name, [text] Student_Location, [text] Student_Department, [number] Student_Phone, [number] Student_Fax, [number] Manager_Name, [text] SendTo_Email) [text] VALUES (#Form.ClassID#, #dateformat(Now(), 'mm/dd/yy')#, '#Variables.StudentName#', '#Variables.StudentLoc#', #Form.DeptNo#, '#variables.studentphone#', '#variables.studentfax#', '#form.managername#', '#form.m_ta_email#') /cfquery _ Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com. Share information about yourself, create your own public profile at http://profiles.msn.com. -- Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body. -- Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body.
RE: division by zero error?
I had this problem once... it is caused by the statement in your code... #dateformat(Now(), 'mm/dd/yy')# Try using double quotes around the date mask... #dateformat(Now(), "mm/dd/yy")#, or remove the slashes... they are what is producing the error. Jay -Original Message- From: Terri Stocke [mailto:[EMAIL PROTECTED]] Sent: Friday, September 15, 2000 12:40 PM To: [EMAIL PROTECTED] Subject: division by zero error? Can anyone tell me what may be causing this error? Error Diagnostic Information ODBC Error Code = 22012 (Division by zero) [Microsoft][ODBC Microsoft Access 97 Driver]Division by zero (null) I am not performing any mathematical operations, nor do I have anything in my CF code that would cause CF to think that that is what I am trying to do. This is really a very simple two-page app. I have also tested this by NOT utilizing the phone and fax fields, with the same result. Here's the query (with their respective data types in brackets): CFQUERY name="SaveReq" datasource="TrainReg" INSERT INTO Request (ClassID, Request_Date, [datetime] Student_Name, [text] Student_Location, [text] Student_Department, [number] Student_Phone, [number] Student_Fax, [number] Manager_Name, [text] SendTo_Email) [text] VALUES (#Form.ClassID#, #dateformat(Now(), 'mm/dd/yy')#, '#Variables.StudentName#', '#Variables.StudentLoc#', #Form.DeptNo#, '#variables.studentphone#', '#variables.studentfax#', '#form.managername#', '#form.m_ta_email#') /cfquery _ Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com. Share information about yourself, create your own public profile at http://profiles.msn.com. -- Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body. -- Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body.
Re: division by zero error?
You need to take the single quotes (') off the number fields: #variables.studentphone# #variables.studentfax# Mary |+--- || "Terri | || Stocke" | || tstocke@hotm| || ail.com | || | || 09/15/2000 | || 12:39 PM | || Please | || respond to | || cf-talk | || | |+--- | || | To: [EMAIL PROTECTED]| | cc: (bcc: Mary Baotic/na/Hyperion) | | Subject: division by zero error? | | Can anyone tell me what may be causing this error? Error Diagnostic Information ODBC Error Code = 22012 (Division by zero) [Microsoft][ODBC Microsoft Access 97 Driver]Division by zero (null) I am not performing any mathematical operations, nor do I have anything in my CF code that would cause CF to think that that is what I am trying to do. This is really a very simple two-page app. I have also tested this by NOT utilizing the phone and fax fields, with the same result. Here's the query (with their respective data types in brackets): CFQUERY name="SaveReq" datasource="TrainReg" INSERT INTO Request (ClassID, Request_Date, [datetime] Student_Name, [text] Student_Location, [text] Student_Department, [number] Student_Phone, [number] Student_Fax, [number] Manager_Name, [text] SendTo_Email) [text] VALUES (#Form.ClassID#, #dateformat(Now(), 'mm/dd/yy')#, '#Variables.StudentName#', '#Variables.StudentLoc#', #Form.DeptNo#, '#variables.studentphone#', '#variables.studentfax#', '#form.managername#', '#form.m_ta_email#') /cfquery _ Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com. Share information about yourself, create your own public profile at http://profiles.msn.com. -- Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body. -- Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body.
Re: division by zero error?
It is your date! It is probably formated like 09/00/00 This would look like division. Make sure there are not quotes around yor date field. Also using the CreatODBCDate() is a good function to use when inserting dates. - Original Message - From: "Terri Stocke" [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, September 15, 2000 11:39 AM Subject: division by zero error? Can anyone tell me what may be causing this error? Error Diagnostic Information ODBC Error Code = 22012 (Division by zero) [Microsoft][ODBC Microsoft Access 97 Driver]Division by zero (null) I am not performing any mathematical operations, nor do I have anything in my CF code that would cause CF to think that that is what I am trying to do. This is really a very simple two-page app. I have also tested this by NOT utilizing the phone and fax fields, with the same result. Here's the query (with their respective data types in brackets): CFQUERY name="SaveReq" datasource="TrainReg" INSERT INTO Request (ClassID, Request_Date, [datetime] Student_Name, [text] Student_Location, [text] Student_Department, [number] Student_Phone, [number] Student_Fax, [number] Manager_Name, [text] SendTo_Email) [text] VALUES (#Form.ClassID#, #dateformat(Now(), 'mm/dd/yy')#, '#Variables.StudentName#', '#Variables.StudentLoc#', #Form.DeptNo#, '#variables.studentphone#', '#variables.studentfax#', '#form.managername#', '#form.m_ta_email#') /cfquery _ Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com. Share information about yourself, create your own public profile at http://profiles.msn.com. -- Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body. -- Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body.
RE: division by zero error?
This is a multi-part message in MIME format. --=_NextPart_000_009B_01C01F38.A0432B00 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit division by zero error?This right here: #dateformat(Now(), 'mm/dd/yy')#, Is what is causing your problem. That would result in this value for today: 09/15/00 since you do not have it surrounded by quotes. If it is in fact a datetime field why not just use the ACCESS function NOW() to populate the date, or the CF function #NOW()#? In either case a true datetime value would be sent to the database, as opposed to the string representation of the date. DC -Original Message- From: Terri Stocke [mailto:[EMAIL PROTECTED]] Sent: Friday, September 15, 2000 16:40 To: [EMAIL PROTECTED] Subject: division by zero error? Can anyone tell me what may be causing this error? Error Diagnostic Information ODBC Error Code = 22012 (Division by zero) [Microsoft][ODBC Microsoft Access 97 Driver]Division by zero (null) I am not performing any mathematical operations, nor do I have anything in my CF code that would cause CF to think that that is what I am trying to do. This is really a very simple two-page app. I have also tested this by NOT utilizing the phone and fax fields, with the same result. Here's the query (with their respective data types in brackets): CFQUERY name="SaveReq" datasource="TrainReg" INSERT INTO Request (ClassID, Request_Date, [datetime] Student_Name, [text] Student_Location, [text] Student_Department, [number] Student_Phone, [number] Student_Fax, [number] Manager_Name, [text] SendTo_Email) [text] VALUES (#Form.ClassID#, #dateformat(Now(), 'mm/dd/yy')#, '#Variables.StudentName#', '#Variables.StudentLoc#', #Form.DeptNo#, '#variables.studentphone#', '#variables.studentfax#', '#form.managername#', '#form.m_ta_email#') /cfquery _ Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com. Share information about yourself, create your own public profile at http://profiles.msn.com. -- Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body. --=_NextPart_000_009B_01C01F38.A0432B00 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable !DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" HTMLHEADTITLEdivision by zero error?/TITLE META content=3D"text/html; charset=3Diso-8859-1" = http-equiv=3DContent-Type META content=3D"MSHTML 5.00.3018.900" name=3DGENERATOR/HEAD BODY DIVFONT color=3D#ff face=3DArial size=3D2SPAN = class=3D241151417-15092000This=20 right here:/SPAN/FONT/DIV DIVFONT color=3D#ff face=3DArial size=3D2SPAN=20 class=3D241151417-15092000/SPAN/FONTnbsp;/DIV DIVFONT color=3D#ff face=3DArial size=3D2SPAN=20 class=3D241151417-15092000#dateformat(Now(),=20 'mm/dd/yy')#,nbsp;BRnbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;F= ONT=20 size=3D2nbsp;nbsp;/FONT/SPAN/FONT/DIV DIVFONT color=3D#ff face=3DArial size=3D2SPAN = class=3D241151417-15092000Is=20 what is causing your problem.nbsp; That would result in this value for = today:=20 09/15/00 since you do not have it surrounded by quotes. If it is in fact = a=20 datetime field why not just use the ACCESS function NOW() to populate = the date,=20 or the CF function #NOW()#?nbsp; In either case a true datetime value = would be=20 sent to the database, as opposed to the string representation of the=20 date./SPAN/FONT/DIV DIVFONT color=3D#ff face=3DArial size=3D2SPAN=20 class=3D241151417-15092000/SPAN/FONTnbsp;/DIV DIVFONT color=3D#ff face=3DArial size=3D2SPAN=20 class=3D241151417-15092000DC/SPAN/FONT/DIV DIVFONT color=3D#ff face=3DArial size=3D2SPAN=20 class=3D241151417-15092000/SPAN/FONTnbsp;/DIV BLOCKQUOTE style=3D"MARGIN-RIGHT: 0px" DIV align=3Dleft class=3DOutlookMessageHeader dir=3DltrFONT = face=3DTahoma=20 size=3D2-Original Message-BRBFrom:/B Terri Stocke=20 [mailto:[EMAIL PROTECTED]]BRBSent:/B Friday, September 15, = 2000=20 16:40BRBTo:/B [EMAIL PROTECTED]BRBSubject:/B = division by=20 zero error?BRBR/DIV/FONT PFONT size=3D2Can anyone tell me what may be causing this = error?/FONT /P PFONT size=3D2Error Diagnostic Information/FONT /P PFONT size=3D2ODBC Error Code =3D 22012 (Division by zero)/FONT = /P PFONT size=3D2[Microsoft][ODBC Microsoft Access 97 Driver]Division = by zero=20 (null)/FONT /P PFONT size=3D2I am not performing any mathematical operations,
RE: Division in Cold Fusion?
I'm sure there's a nifty function that does exactly that for you - but without looking in the manual you could always do this: !--- Move the calculation over two decimal places, add .5 and truncate, then move it back --- cfset result = ( thisval / thatval * 100 + 0.5 ) \ 100 At 03:06 PM 8/23/00 -0400, Peter Benoit wrote: Thanks for all the help with this one. One final question would be, is there a way to round the results of this to say 2 decimal places? It's hard to find what you're looking for when you don't know what you're looking for! :) Thanks again, Pete * -Original Message- * From: Chapman, Katrina [mailto:[EMAIL PROTECTED]] * Sent: Wednesday, August 23, 2000 2:50 PM * To: [EMAIL PROTECTED] * Subject: RE: Division in Cold Fusion? * * * Just like you did but you're using the wrong slash it should be. * * CFSET MYVAL = thisval / thatval * * BTW you also don't need #'s in set's unless the variable * name is in ""'s. * * HTH, * --K * * -Original Message- * From: Peter Benoit [mailto:[EMAIL PROTECTED]] * Sent: Wednesday, August 23, 2000 11:33 AM * To: '[EMAIL PROTECTED]' * Subject: Division in Cold Fusion? * * * I must be looking at all the wrong stuff... but I want to * take 2 values and * divide them. * * like: * * cfset myval = #thisval# \ #thatval# * * Is there a correct way to do this? * * Thanks, * Pete * * - * --- * -- * Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ * To Unsubscribe visit * http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lis ts/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body. -- Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body. -- Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body. --- Peter Theobald, Chief Technology Officer LiquidStreaming http://www.liquidstreaming.com [EMAIL PROTECTED] Phone 1.212.545.1232 Fax 1.212.679.8032 -- Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body.
Re: Division in Cold Fusion?
The correct way is: cfset myval = #thisval# / #thatval# You almost had it right - just had the slash turned around. g Dave = "What we need is a list of specific unknown problems we will encounter" David Hannum Web Analyst/Programmer Ohio University [EMAIL PROTECTED] (740) 597-2524 - Original Message - From: "Peter Benoit" [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, August 23, 2000 2:33 PM Subject: Division in Cold Fusion? I must be looking at all the wrong stuff... but I want to take 2 values and divide them. like: cfset myval = #thisval# \ #thatval# Is there a correct way to do this? Thanks, Pete -- Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body. -- Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body.
Re: Division in Cold Fusion?
cfset myval = thisval / thatval should work. -- Jamie Keane Programmer SolutionMasters, Inc. 9111 Monroe Rd., Suite 100 Charlotte, NC 28270 www.solutionmasters.com 704.563.5559 x 228 Voice 704.849.9291 Fax -Original Message- From: Peter Benoit [EMAIL PROTECTED] To: '[EMAIL PROTECTED]' [EMAIL PROTECTED] Date: Wednesday, August 23, 2000 2:37 PM Subject: Division in Cold Fusion? I must be looking at all the wrong stuff... but I want to take 2 values and divide them. like: cfset myval = #thisval# \ #thatval# Is there a correct way to do this? Thanks, Pete --- --- Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body. -- Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body.
RE: Division in Cold Fusion?
Just like you did but you're using the wrong slash it should be. CFSET MYVAL = thisval / thatval BTW you also don't need #'s in set's unless the variable name is in ""'s. HTH, --K -Original Message- From: Peter Benoit [mailto:[EMAIL PROTECTED]] Sent: Wednesday, August 23, 2000 11:33 AM To: '[EMAIL PROTECTED]' Subject: Division in Cold Fusion? I must be looking at all the wrong stuff... but I want to take 2 values and divide them. like: cfset myval = #thisval# \ #thatval# Is there a correct way to do this? Thanks, Pete -- Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body. -- Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body.
Re: Division in Cold Fusion?
The backwards slash will divide and truncate the remainder, ie: it is an INTEGER divide. Use the normal / if you want to just divide. At 02:33 PM 8/23/00 -0400, Peter Benoit wrote: I must be looking at all the wrong stuff... but I want to take 2 values and divide them. like: cfset myval = #thisval# \ #thatval# Is there a correct way to do this? Thanks, Pete -- Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body. --- Peter Theobald, Chief Technology Officer LiquidStreaming http://www.liquidstreaming.com [EMAIL PROTECTED] Phone 1.212.545.1232 Fax 1.212.679.8032 -- Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body.
RE: Division in Cold Fusion?
Thanks for all the help with this one. One final question would be, is there a way to round the results of this to say 2 decimal places? It's hard to find what you're looking for when you don't know what you're looking for! :) Thanks again, Pete * -Original Message- * From: Chapman, Katrina [mailto:[EMAIL PROTECTED]] * Sent: Wednesday, August 23, 2000 2:50 PM * To: [EMAIL PROTECTED] * Subject: RE: Division in Cold Fusion? * * * Just like you did but you're using the wrong slash it should be. * * CFSET MYVAL = thisval / thatval * * BTW you also don't need #'s in set's unless the variable * name is in ""'s. * * HTH, * --K * * -Original Message- * From: Peter Benoit [mailto:[EMAIL PROTECTED]] * Sent: Wednesday, August 23, 2000 11:33 AM * To: '[EMAIL PROTECTED]' * Subject: Division in Cold Fusion? * * * I must be looking at all the wrong stuff... but I want to * take 2 values and * divide them. * * like: * * cfset myval = #thisval# \ #thatval# * * Is there a correct way to do this? * * Thanks, * Pete * * - * --- * -- * Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ * To Unsubscribe visit * http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lis ts/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body. -- Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body. -- Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body.
RE: Division in Cold Fusion?
#DecimalFormat(variable)# this will automatically use two decimal places. search for it in the help if you want another format. Chris Olive, DOEHRS Website Administrator -Original Message- From: Peter Benoit [mailto:[EMAIL PROTECTED]] Sent: Wednesday, August 23, 2000 3:06 PM To: '[EMAIL PROTECTED]' Subject: RE: Division in Cold Fusion? Thanks for all the help with this one. One final question would be, is there a way to round the results of this to say 2 decimal places? It's hard to find what you're looking for when you don't know what you're looking for! :) Thanks again, Pete * -Original Message- * From: Chapman, Katrina [mailto:[EMAIL PROTECTED]] * Sent: Wednesday, August 23, 2000 2:50 PM * To: [EMAIL PROTECTED] * Subject: RE: Division in Cold Fusion? * * * Just like you did but you're using the wrong slash it should be. * * CFSET MYVAL = thisval / thatval * * BTW you also don't need #'s in set's unless the variable * name is in ""'s. * * HTH, * --K * * -Original Message- * From: Peter Benoit [mailto:[EMAIL PROTECTED]] * Sent: Wednesday, August 23, 2000 11:33 AM * To: '[EMAIL PROTECTED]' * Subject: Division in Cold Fusion? * * * I must be looking at all the wrong stuff... but I want to * take 2 values and * divide them. * * like: * * cfset myval = #thisval# \ #thatval# * * Is there a correct way to do this? * * Thanks, * Pete * * - * --- * -- * Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ * To Unsubscribe visit * http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lis ts/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body. -- Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body. -- Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body. -- Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body.
RE: Division in Cold Fusion?
I must be looking at all the wrong stuff... but I want to take 2 values and divide them. like: cfset myval = #thisval# \ #thatval# Is there a correct way to do this? You have the wrong slash cfset myval = thisval / thatval Philip Arnold ASP Multimedia Limited T: +44 (0)20 8680 1133 "Websites for the real world" ** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. ** -- Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body.
Re: Division in Cold Fusion?
On 8/23/00, Peter Benoit penned: cfset myval = #thisval# \ #thatval# Use a forward slash. Geesh, you Windows people. LOL Oh, you shouldn't use the pound signs inside a cfset either. Just don't put double or single quotes around them and CF will know they're variables. -- Bud Schneehagen - Tropical Web Creations _/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/ ColdFusion Solutions / eCommerce Development [EMAIL PROTECTED] http://www.twcreations.com/ 954.721.3452 -- Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body.
RE: Division in Cold Fusion?
Well the backslash I saw somewhere (no can't remember where) and it worked, just not the way I expected it to. * -Original Message- * From: Bud [mailto:[EMAIL PROTECTED]] * Sent: Wednesday, August 23, 2000 3:30 PM * To: [EMAIL PROTECTED] * Subject: Re: Division in Cold Fusion? * * * On 8/23/00, Peter Benoit penned: * cfset myval = #thisval# \ #thatval# * * Use a forward slash. * * Geesh, you Windows people. LOL * * Oh, you shouldn't use the pound signs inside a cfset either. Just * don't put double or single quotes around them and CF will know * they're variables. * -- * * Bud Schneehagen - Tropical Web Creations * * _/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/ * ColdFusion Solutions / eCommerce Development * [EMAIL PROTECTED] * http://www.twcreations.com/ * 954.721.3452 * - * - * Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ * To Unsubscribe visit * http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lis ts/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body. -- Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body.
Re: Division in Cold Fusion?
I must be looking at all the wrong stuff... but I want to take 2 values and divide them. Try: cfset myval = evaluate(thisval/thatval) Rob Keniger -- Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body.