[cfaussie] Re: A domain error occurred in CF with MS SQL 2005
could it be related to: http://www.sql-server-performance.com/faq/sqlviewfaq.aspx?faqid=208 but then you mentioned it runs ok on the database itself. >>> "Taco Fleur" <[EMAIL PROTECTED]> 26/06/2007 11:57 am >>> Hello all, I am getting the following error "A domain error occurred" [Macromedia][SQLServer JDBC Driver][SQLServer]A domain error occurred. The cfquery tag is calling a stored procedure, and when I call that procedure directly on the database with the same values there appears to be no problem. So, I;m guessing it has something to do with the driver? Has anyone seen this before? Any help or hints will be much appreciated. -- http://www.clickfind.com.au The new Australian search engine for businesses, products and services --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "cfaussie" group. To post to this group, send email to cfaussie@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cfaussie?hl=en -~--~~~~--~~--~--~---
[cfaussie] Re: A domain error occurred in CF with MS SQL 2005
thanks, just found the same article. I thought the data was the same on the database I tested it, but it wasn't, so its not an ODBC error. It should be as per the article a problem with some of the numbers. Now I need to figure out what numbers Thanks.. On 6/26/07, Scott Thornton <[EMAIL PROTECTED]> wrote: > > > could it be related to: > > http://www.sql-server-performance.com/faq/sqlviewfaq.aspx?faqid=208 > > but then you mentioned it runs ok on the database itself. > > >>> "Taco Fleur" <[EMAIL PROTECTED]> 26/06/2007 11:57 am >>> > Hello all, > > I am getting the following error "A domain error occurred" > [Macromedia][SQLServer JDBC Driver][SQLServer]A domain error occurred. > > The cfquery tag is calling a stored procedure, and when I call that > procedure directly on the database with the same values there appears to > be > no problem. > > So, I;m guessing it has something to do with the driver? Has anyone seen > this before? > Any help or hints will be much appreciated. > > -- > http://www.clickfind.com.au > The new Australian search engine for businesses, products and services > > > > > > > -- *** { . } { . } http://www.clickfind.com.au The new Australian search engine for businesses, products and services --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "cfaussie" group. To post to this group, send email to cfaussie@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cfaussie?hl=en -~--~~~~--~~--~--~---
[cfaussie] Re: A domain error occurred in CF with MS SQL 2005
OK, I've narrowed it down to the following code and values. I also see that other people have had the same problem, no answers listed in the forums though. The offending code is; DECLARE @fromLatitude AS REAL , @fromLongitude AS REAL , @toLatitude AS REAL , @toLongitude AS REAL SET @fromLatitude = -31.111695 SET @fromLongitude = 117.792134 SET @toLatitude = -31.111695 SET @toLongitude = 117.792134 DECLARE @distance REAL SET @distance = ( ROUND( ( ACOS( ( SIN( @fromLatitude / 57.2958 ) * SIN(@toLatitude / 57.2958 ) ) + ( COS ( @fromLatitude / 57.2958 ) * COS( @toLatitude / 57.2958 ) * COS(@toLongitude /57.2958 - @fromLongitude / 57.2958 ) ) ) ) * 6378.135, 3 ) ) SELECT @distance; On 6/26/07, Scott Thornton <[EMAIL PROTECTED]> wrote: > > > could it be related to: > > http://www.sql-server-performance.com/faq/sqlviewfaq.aspx?faqid=208 > > but then you mentioned it runs ok on the database itself. > > >>> "Taco Fleur" <[EMAIL PROTECTED]> 26/06/2007 11:57 am >>> > Hello all, > > I am getting the following error "A domain error occurred" > [Macromedia][SQLServer JDBC Driver][SQLServer]A domain error occurred. > > The cfquery tag is calling a stored procedure, and when I call that > procedure directly on the database with the same values there appears to > be > no problem. > > So, I;m guessing it has something to do with the driver? Has anyone seen > this before? > Any help or hints will be much appreciated. > > -- > http://www.clickfind.com.au > The new Australian search engine for businesses, products and services > > > > > > > -- *** { . } { . } http://www.clickfind.com.au The new Australian search engine for businesses, products and services --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "cfaussie" group. To post to this group, send email to cfaussie@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cfaussie?hl=en -~--~~~~--~~--~--~---
[cfaussie] Re: A domain error occurred in CF with MS SQL 2005
The following does not generate an error, replace the values with the previous ones and the domain error occurs. DECLARE @fromLatitude AS REAL , @fromLongitude AS REAL , @toLatitude AS REAL , @toLongitude AS REAL SET @fromLatitude = -27.339993 SET @fromLongitude = 152.936964 SET @toLatitude = -27.339993 SET @toLongitude = 152.936964 DECLARE @distance REAL SET @distance = ( ROUND( ( ACOS( ( SIN( @fromLatitude / 57.2958 ) * SIN(@toLatitude / 57.2958 ) ) + ( COS ( @fromLatitude / 57.2958 ) * COS( @toLatitude / 57.2958 ) * COS(@toLongitude /57.2958 - @fromLongitude / 57.2958 ) ) ) ) * 6378.135, 3 ) ) SELECT @distance; On 6/26/07, Scott Thornton <[EMAIL PROTECTED]> wrote: > > > Would you mind posting the formula? also reformatting the code with tab's? > > round( > ACOS( > ) > ,3) > > I have been playing around with it and got it to work but I am not sure if > it what was intended as I mucked around with the brackets. There seemed to > be spare brackets about. > > > >>> "Taco Fleur" <[EMAIL PROTECTED]> 26/06/2007 12:40 pm >>> > OK, I've narrowed it down to the following code and values. I also see > that > other people have had the same problem, no answers listed in the forums > though. > > The offending code is; > > > DECLARE @fromLatitude AS REAL > > , @fromLongitude AS REAL > > , @toLatitude AS REAL > > , @toLongitude AS REAL > > SET @fromLatitude = -31.111695 > > SET @fromLongitude = 117.792134 > > SET @toLatitude = -31.111695 > > SET @toLongitude = 117.792134 > > > > DECLARE @distance REAL > > SET @distance = ( ROUND( ( ACOS( ( SIN( @fromLatitude / 57.2958 ) * > SIN(@toLatitude > / 57.2958 ) ) + > > ( COS ( @fromLatitude / 57.2958 ) * COS( @toLatitude / 57.2958 ) * > COS(@toLongitude > /57.2958 - @fromLongitude / 57.2958 ) ) ) ) * 6378.135, 3 ) ) > > SELECT @distance; > > > > On 6/26/07, Scott Thornton <[EMAIL PROTECTED]> wrote: > > > > > > could it be related to: > > > > http://www.sql-server-performance.com/faq/sqlviewfaq.aspx?faqid=208 > > > > but then you mentioned it runs ok on the database itself. > > > > >>> "Taco Fleur" <[EMAIL PROTECTED]> 26/06/2007 11:57 am >>> > > Hello all, > > > > I am getting the following error "A domain error occurred" > > [Macromedia][SQLServer JDBC Driver][SQLServer]A domain error occurred. > > > > The cfquery tag is calling a stored procedure, and when I call that > > procedure directly on the database with the same values there appears to > > be > > no problem. > > > > So, I;m guessing it has something to do with the driver? Has anyone seen > > this before? > > Any help or hints will be much appreciated. > > > > -- > > http://www.clickfind.com.au > > The new Australian search engine for businesses, products and services > > > > > > > > > > > > > > > > -- > *** { . } { . } > http://www.clickfind.com.au > The new Australian search engine for businesses, products and services > > > > > > > -- *** { . } { . } http://www.clickfind.com.au The new Australian search engine for businesses, products and services --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "cfaussie" group. To post to this group, send email to cfaussie@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cfaussie?hl=en -~--~~~~--~~--~--~---
[cfaussie] Re: A domain error occurred in CF with MS SQL 2005
I just realized I did not post the offending code, the code that generates the error is; DECLARE @fromLatitude AS REAL , @fromLongitude AS REAL , @toLatitude AS REAL , @toLongitude AS REAL SET @fromLatitude = -31.111695 SET @fromLongitude = 117.792134 SET @toLatitude = -31.111695 SET @toLongitude = 117.792134 DECLARE @distance REAL SET @distance = ( ROUND( ( ACOS( ( SIN( @fromLatitude / 57.2958 ) * SIN(@toLatitude / 57.2958 ) ) + ( COS ( @fromLatitude / 57.2958 ) * COS( @toLatitude / 57.2958 ) * COS(@toLongitude /57.2958 - @fromLongitude / 57.2958 ) ) ) ) * 6378.135, 3 ) ) SELECT @distance; On 6/26/07, Taco Fleur <[EMAIL PROTECTED]> wrote: > > The following does not generate an error, replace the values with the > previous ones and the domain error occurs. > > DECLARE @fromLatitude AS REAL > > , > @fromLongitude AS REAL > > , > @toLatitude AS REAL > > , > @toLongitude AS REAL > > SET > @fromLatitude = -27.339993 > > SET > @fromLongitude = 152.936964 > > SET > @toLatitude = -27.339993 > > SET > @toLongitude = 152.936964 > > DECLARE > @distance REAL > > SET > @distance = ( ROUND ( ( ACOS( ( SIN( @fromLatitude / 57.2958 ) * > SIN(@toLatitude > / 57.2958 ) ) + > > ( > COS ( @fromLatitude / 57.2958 ) * COS( @toLatitude / 57.2958 ) * > COS(@toLongitude > /57.2958 - @fromLongitude / 57.2958 ) ) ) ) * 6378.135, 3 ) ) > > SELECT > @distance; > > > > > On 6/26/07, Scott Thornton <[EMAIL PROTECTED]> wrote: > > > > > > Would you mind posting the formula? also reformatting the code with > > tab's? > > > > round( > > ACOS( > > ) > > ,3) > > > > I have been playing around with it and got it to work but I am not sure > > if it what was intended as I mucked around with the brackets. There seemed > > to be spare brackets about. > > > > > > >>> "Taco Fleur" < [EMAIL PROTECTED]> 26/06/2007 12:40 pm >>> > > OK, I've narrowed it down to the following code and values. I also see > > that > > other people have had the same problem, no answers listed in the forums > > though. > > > > The offending code is; > > > > > > DECLARE @fromLatitude AS REAL > > > > , @fromLongitude AS REAL > > > > , @toLatitude AS REAL > > > > , @toLongitude AS REAL > > > > SET @fromLatitude = -31.111695 > > > > SET @fromLongitude = 117.792134 > > > > SET @toLatitude = -31.111695 > > > > SET @toLongitude = 117.792134 > > > > > > > > DECLARE @distance REAL > > > > SET @distance = ( ROUND( ( ACOS( ( SIN( @fromLatitude / 57.2958 ) * > > SIN(@toLatitude > > / 57.2958 ) ) + > > > > ( COS ( @fromLatitude / 57.2958 ) * COS( @toLatitude / 57.2958 ) * > > COS(@toLongitude > > /57.2958 - @fromLongitude / 57.2958 ) ) ) ) * 6378.135, 3 ) ) > > > > SELECT @distance; > > > > > > > > On 6/26/07, Scott Thornton < [EMAIL PROTECTED]> wrote: > > > > > > > > > could it be related to: > > > > > > http://www.sql-server-performance.com/faq/sqlviewfaq.aspx?faqid=208 > > > > > > but then you mentioned it runs ok on the database itself. > > > > > > >>> "Taco Fleur" < [EMAIL PROTECTED]> 26/06/2007 11:57 am >>> > > > Hello all, > > > > > > I am getting the following error "A domain error occurred" > > > [Macromedia][SQLServer JDBC Driver][SQLServer]A domain error occurred. > > > > > > > > The cfquery tag is calling a stored procedure, and when I call that > > > procedure directly on the database with the same values there appears > > to > > > be > > > no problem. > > > > > > So, I;m guessing it has something to do with the driver? Has anyone > > seen > > > this before? > > > Any help or hints will be much appreciated. > > > > > > -- > > > http://www.clickfind.com.au > > > The new Australian search engine for businesses, products and services > > > > > > > > > > > > > > > > > > > > > > > > > > > -- > > *** { . } { . } > > http://www.clickfind.com.au > > The new Australian search engine for businesses, products and services > > > > > > > > > > > > > > > > > -- > *** { . } { . } > http://www.clickfind.com.au > The new Australian search engine for businesses, products and services > -- *** { . } { . } http://www.clickfind.com.au The new Australian search engine for businesses, products and services --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "cfaussie" group. To post to this group, send email to cfaussie@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cfaussie?hl=en -~--~~~~--~~--~--~---
[cfaussie] Re: A domain error occurred in CF with MS SQL 2005
What version of Windows? What version of SQL Server 2005 (have you applied all the service packs)? What version of ColdFusion? On 26/06/07, Taco Fleur <[EMAIL PROTECTED]> wrote: > I just realized I did not post the offending code, the code that generates > the error is; > > > > > DECLARE @fromLatitude AS REAL > > , @fromLongitude AS REAL > > , @toLatitude AS REAL > > , @toLongitude AS REAL > > SET @fromLatitude = -31.111695 > > SET @fromLongitude = 117.792134 > > SET @toLatitude = -31.111695 > > SET @toLongitude = 117.792134 > > > > DECLARE @distance REAL > > SET @distance = ( ROUND ( ( ACOS( ( SIN( @fromLatitude / 57.2958 ) * SIN( > @toLatitude / 57.2958 ) ) + > > ( COS ( @fromLatitude / 57.2958 ) * COS ( @toLatitude / 57.2958 ) * COS( > @toLongitude/57.2958 - @fromLongitude / 57.2958 ) ) ) ) * 6378.135 , 3 ) ) > > SELECT @distance; > > > On 6/26/07, Taco Fleur <[EMAIL PROTECTED]> wrote: > > > > > > The following does not generate an error, replace the values with the > previous ones and the domain error occurs. > > > > DECLARE @fromLatitude AS REAL > > > > ,@fromLongitude AS REAL > > > > ,@toLatitude AS REAL > > > > ,@toLongitude AS REAL > > > > [EMAIL PROTECTED] = -27.339993 > > > > [EMAIL PROTECTED] = 152.936964 > > > > [EMAIL PROTECTED] = -27.339993 > > > > [EMAIL PROTECTED] = 152.936964 > > > > > > > > > > [EMAIL PROTECTED] REAL > > > > [EMAIL PROTECTED] = ( ROUND ( ( ACOS( ( SIN( @fromLatitude / 57.2958 ) * > > SIN( > @toLatitude / 57.2958 ) ) + > > > > (COS ( @fromLatitude / 57.2958 ) * COS( @toLatitude / 57.2958 ) * COS( > @toLongitude/57.2958 - @fromLongitude / 57.2958 ) ) ) ) * 6378.135, 3 ) ) > > > > [EMAIL PROTECTED]; > > > > > > > > > > > > > > On 6/26/07, Scott Thornton > <[EMAIL PROTECTED] > wrote: > > > > > > Would you mind posting the formula? also reformatting the code with > tab's? > > > > > > round( > > > ACOS( > > > ) > > > ,3) > > > > > > I have been playing around with it and got it to work but I am not sure > if it what was intended as I mucked around with the brackets. There seemed > to be spare brackets about. > > > > > > > > > >>> "Taco Fleur" < [EMAIL PROTECTED]> 26/06/2007 12:40 pm >>> > > > OK, I've narrowed it down to the following code and values. I also see > that > > > other people have had the same problem, no answers listed in the forums > > > though. > > > > > > The offending code is; > > > > > > > > > DECLARE @fromLatitude AS REAL > > > > > > , @fromLongitude AS REAL > > > > > > , @toLatitude AS REAL > > > > > > , @toLongitude AS REAL > > > > > > SET @fromLatitude = -31.111695 > > > > > > SET @fromLongitude = 117.792134 > > > > > > SET @toLatitude = -31.111695 > > > > > > SET @toLongitude = 117.792134 > > > > > > > > > > > > DECLARE @distance REAL > > > > > > SET @distance = ( ROUND( ( ACOS( ( SIN( @fromLatitude / 57.2958 ) * > > > SIN(@toLatitude > > > / 57.2958 ) ) + > > > > > > ( COS ( @fromLatitude / 57.2958 ) * COS( @toLatitude / 57.2958 ) * > > > COS(@toLongitude > > > /57.2958 - @fromLongitude / 57.2958 ) ) ) ) * 6378.135, 3 ) ) > > > > > > SELECT @distance; > > > > > > > > > > > > On 6/26/07, Scott Thornton < > [EMAIL PROTECTED]> wrote: > > > > > > > > > > > > could it be related to: > > > > > > > > > http://www.sql-server-performance.com/faq/sqlviewfaq.aspx?faqid=208 > > > > > > > > but then you mentioned it runs ok on the database itself. > > > > > > > > >>> "Taco Fleur" < [EMAIL PROTECTED]> 26/06/2007 11:57 am >>> > > > > Hello all, > > > > > > > > I am getting the following error "A domain error occurred" > > > > [Macromedia][SQLServer JDBC Driver][SQLServer]A domain error occurred. > > > > > > > > The cfquery tag is calling a stored procedure, and when I call that > > > > procedure directly on the database with the same values there appears > to > > > > be > > > > no problem. > > > > > > > > So, I;m guessing it has something to do with the driver? Has anyone > seen > > > > this before? > > > > Any help or hints will be much appreciated. > > > > > > > > -- > > > > http://www.clickfind.com.au > > > > The new Australian search engine for businesses, products and services > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > -- > > > *** { . } { . } > > > http://www.clickfind.com.au > > > The new Australian search engine for businesses, products and services > > > > > > > > > > > > > > > > > > > > > http://www.clickfind.com.au > > > The new Australian search engine for businesses, products and services > > > > > > > > -- > > *** { . } { . } > > http://www.clickfind.com.au > > The new Australian search engine for businesses, products and services > > > > > > > -- Peter Tilbrook ColdGen Internet Solutions President, ACT and Region ColdFusion Users Group PO Box 2247 Queanbeyan, NSW, 2620 AUSTRALIA http://www.coldgen.com/ http://www.actcfug.com/ Tel: +61-2-6284-2727 Mob: +61-0432-897-437 Email: [EMAIL PROTECTED] MSN Messenger Live: Desktop General --~--~-~--~~~---~--~~ You received this message
[cfaussie] Re: A domain error occurred in CF with MS SQL 2005
Don't forget what version of the request scope either Peter:-) Andrew Scott Senior Coldfusion Developer Aegeon Pty. Ltd. www.aegeon.com.au Phone: +613 8676 4223 Mobile: 0404 998 273 -Original Message- From: cfaussie@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Peter Tilbrook Sent: Tuesday, 26 June 2007 2:55 PM To: cfaussie@googlegroups.com Subject: [cfaussie] Re: A domain error occurred in CF with MS SQL 2005 What version of Windows? What version of SQL Server 2005 (have you applied all the service packs)? What version of ColdFusion? No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.5.476 / Virus Database: 269.9.8/869 - Release Date: 25/06/2007 5:32 PM --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "cfaussie" group. To post to this group, send email to cfaussie@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cfaussie?hl=en -~--~~~~--~~--~--~---
[cfaussie] Re: A domain error occurred in CF with MS SQL 2005
Just got the solution to this, it had to do with rounding. Beats me why, but thats what it was anyways. Thanks for helping. SET @distance = ( ROUND( ( ACOS( ROUND( ( SIN( @fromLatitude / 57.2958) * SIN( @toLatitude / 57.2958 ) ) + ( COS( @fromLatitude / 57.2958 ) * COS( @toLatitude / 57.2958 ) * COS(@toLongitude / 57.2958 - @fromLongitude / 57.2958 ) ), 3) ) ) * 6378.135, 3) ) On 6/26/07, Scott Thornton <[EMAIL PROTECTED]> wrote: > > > Would you mind posting the formula? also reformatting the code with tab's? > > round( > ACOS( > ) > ,3) > > I have been playing around with it and got it to work but I am not sure if > it what was intended as I mucked around with the brackets. There seemed to > be spare brackets about. > > > >>> "Taco Fleur" <[EMAIL PROTECTED]> 26/06/2007 12:40 pm >>> > OK, I've narrowed it down to the following code and values. I also see > that > other people have had the same problem, no answers listed in the forums > though. > > The offending code is; > > > DECLARE @fromLatitude AS REAL > > , @fromLongitude AS REAL > > , @toLatitude AS REAL > > , @toLongitude AS REAL > > SET @fromLatitude = -31.111695 > > SET @fromLongitude = 117.792134 > > SET @toLatitude = -31.111695 > > SET @toLongitude = 117.792134 > > > > DECLARE @distance REAL > > SET @distance = ( ROUND( ( ACOS( ( SIN( @fromLatitude / 57.2958 ) * > SIN(@toLatitude > / 57.2958 ) ) + > > ( COS ( @fromLatitude / 57.2958 ) * COS( @toLatitude / 57.2958 ) * > COS(@toLongitude > /57.2958 - @fromLongitude / 57.2958 ) ) ) ) * 6378.135, 3 ) ) > > SELECT @distance; > > > > On 6/26/07, Scott Thornton <[EMAIL PROTECTED]> wrote: > > > > > > could it be related to: > > > > http://www.sql-server-performance.com/faq/sqlviewfaq.aspx?faqid=208 > > > > but then you mentioned it runs ok on the database itself. > > > > >>> "Taco Fleur" <[EMAIL PROTECTED]> 26/06/2007 11:57 am >>> > > Hello all, > > > > I am getting the following error "A domain error occurred" > > [Macromedia][SQLServer JDBC Driver][SQLServer]A domain error occurred. > > > > The cfquery tag is calling a stored procedure, and when I call that > > procedure directly on the database with the same values there appears to > > be > > no problem. > > > > So, I;m guessing it has something to do with the driver? Has anyone seen > > this before? > > Any help or hints will be much appreciated. > > > > -- > > http://www.clickfind.com.au > > The new Australian search engine for businesses, products and services > > > > > > > > > > > > > > > > -- > *** { . } { . } > http://www.clickfind.com.au > The new Australian search engine for businesses, products and services > > > > > > > -- *** { . } { . } http://www.clickfind.com.au The new Australian search engine for businesses, products and services --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "cfaussie" group. To post to this group, send email to cfaussie@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cfaussie?hl=en -~--~~~~--~~--~--~---
[cfaussie] Re: A domain error occurred in CF with MS SQL 2005
Hi Taco, Out of interest, what are you building. I need to add distance calculations (in the future) to a temporal/spatial mapping interface I have just finished building http://www.nams.gov.au/index.cfm?fa=mui.run . Cheers, Simon On 26/06/07, Taco Fleur <[EMAIL PROTECTED]> wrote: > > Just got the solution to this, it had to do with rounding. Beats me why, > but thats what it was anyways. > Thanks for helping. > > > SET > @distance = ( ROUND ( ( ACOS( ROUND( ( SIN( @fromLatitude / 57.2958) * SIN > ( @toLatitude / 57.2958 ) ) > > + > ( COS( @fromLatitude / 57.2958 ) * COS ( @toLatitude / 57.2958 ) * > COS(@toLongitude > / 57.2958 - @fromLongitude / 57.2958 ) ), 3) ) ) * 6378.135, 3) ) > > > On 6/26/07, Scott Thornton <[EMAIL PROTECTED]> wrote: > > > > > > Would you mind posting the formula? also reformatting the code with > > tab's? > > > > round( > > ACOS( > > ) > > ,3) > > > > I have been playing around with it and got it to work but I am not sure > > if it what was intended as I mucked around with the brackets. There seemed > > to be spare brackets about. > > > > > > >>> "Taco Fleur" < [EMAIL PROTECTED]> 26/06/2007 12:40 pm >>> > > OK, I've narrowed it down to the following code and values. I also see > > that > > other people have had the same problem, no answers listed in the forums > > though. > > > > The offending code is; > > > > > > DECLARE @fromLatitude AS REAL > > > > , @fromLongitude AS REAL > > > > , @toLatitude AS REAL > > > > , @toLongitude AS REAL > > > > SET @fromLatitude = -31.111695 > > > > SET @fromLongitude = 117.792134 > > > > SET @toLatitude = -31.111695 > > > > SET @toLongitude = 117.792134 > > > > > > > > DECLARE @distance REAL > > > > SET @distance = ( ROUND( ( ACOS( ( SIN( @fromLatitude / 57.2958 ) * > > SIN(@toLatitude > > / 57.2958 ) ) + > > > > ( COS ( @fromLatitude / 57.2958 ) * COS( @toLatitude / 57.2958 ) * > > COS(@toLongitude > > /57.2958 - @fromLongitude / 57.2958 ) ) ) ) * 6378.135, 3 ) ) > > > > SELECT @distance; > > > > > > > > On 6/26/07, Scott Thornton < [EMAIL PROTECTED]> wrote: > > > > > > > > > could it be related to: > > > > > > http://www.sql-server-performance.com/faq/sqlviewfaq.aspx?faqid=208 > > > > > > but then you mentioned it runs ok on the database itself. > > > > > > >>> "Taco Fleur" < [EMAIL PROTECTED]> 26/06/2007 11:57 am >>> > > > Hello all, > > > > > > I am getting the following error "A domain error occurred" > > > [Macromedia][SQLServer JDBC Driver][SQLServer]A domain error occurred. > > > > > > > > The cfquery tag is calling a stored procedure, and when I call that > > > procedure directly on the database with the same values there appears > > to > > > be > > > no problem. > > > > > > So, I;m guessing it has something to do with the driver? Has anyone > > seen > > > this before? > > > Any help or hints will be much appreciated. > > > > > > -- > > > http://www.clickfind.com.au > > > The new Australian search engine for businesses, products and services > > > > > > > > > > > > > > > > > > > > > > > > > > > -- > > *** { . } { . } > > http://www.clickfind.com.au > > The new Australian search engine for businesses, products and services > > > > > > > > > > http://www.clickfind.com.au > > The new Australian search engine for businesses, products and services > > > > > > -- Cheers Simon Haddon --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "cfaussie" group. To post to this group, send email to cfaussie@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cfaussie?hl=en -~--~~~~--~~--~--~---
[cfaussie] Re: A domain error occurred in CF with MS SQL 2005
Cheers for posting your solution - I was encountering exactly the same problem and was getting very frustrated. However I think you'll find that if you round to 15 decimal places instead of 3 you'll get much better results (rounding to 16 places and above will result in the error re-occurring). I've been doing a nearby / proximity search using this calculation myself and get quite different results depending upon how many decimal places I round to. So for anyone who just wants to copy and paste, use this instead: SET @distance = @EarthRadius * ACOS(ROUND( (SIN(RADIANS(@fromLatitude)) * SIN(RADIANS(@toLatitude))) + (COS(RADIANS(@fromLatitude)) * COS(RADIANS(@toLatitude)) * COS(RADIANS(@toLongitude) - RADIANS(@fromLongitude))),15)) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "cfaussie" group. To post to this group, send email to cfaussie@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cfaussie?hl=en -~--~~~~--~~--~--~---
[cfaussie] Re: A domain error occurred in CF with MS SQL 2005
Hi Simon, The calculation should work nicely for you. Please not my other post though - I think decimal place rounding should be increased from 3 to 15 to get better results. Gavin. On Jun 28, 9:17 am, "Simon Haddon" <[EMAIL PROTECTED]> wrote: > Hi Taco, > > Out of interest, what are you building. I need to add distance calculations > (in the future) to a temporal/spatial mapping interface I have just finished > buildinghttp://www.nams.gov.au/index.cfm?fa=mui.run. > > Cheers, > Simon > > On 26/06/07, Taco Fleur <[EMAIL PROTECTED]> wrote: > > > > > > > Just got the solution to this, it had to do with rounding. Beats me why, > > but thats what it was anyways. > > Thanks for helping. > > > SET > > @distance = ( ROUND ( ( ACOS( ROUND( ( SIN( @fromLatitude / 57.2958) * SIN > > ( @toLatitude / 57.2958 ) ) > > > + > > ( COS( @fromLatitude / 57.2958 ) * COS ( @toLatitude / 57.2958 ) * > > COS(@toLongitude > > / 57.2958 - @fromLongitude / 57.2958 ) ), 3) ) ) * 6378.135, 3) ) > > > On 6/26/07, Scott Thornton <[EMAIL PROTECTED]> wrote: > > > > Would you mind posting the formula? also reformatting the code with > > > tab's? > > > > round( > > > ACOS( > > > ) > > > ,3) > > > > I have been playing around with it and got it to work but I am not sure > > > if it what was intended as I mucked around with the brackets. There seemed > > > to be spare brackets about. > > > > >>> "Taco Fleur" < [EMAIL PROTECTED]> 26/06/2007 12:40 pm >>> > > > OK, I've narrowed it down to the following code and values. I also see > > > that > > > other people have had the same problem, no answers listed in the forums > > > though. > > > > The offending code is; > > > > DECLARE @fromLatitude AS REAL > > > > , @fromLongitude AS REAL > > > > , @toLatitude AS REAL > > > > , @toLongitude AS REAL > > > > SET @fromLatitude = -31.111695 > > > > SET @fromLongitude = 117.792134 > > > > SET @toLatitude = -31.111695 > > > > SET @toLongitude = 117.792134 > > > > DECLARE @distance REAL > > > > SET @distance = ( ROUND( ( ACOS( ( SIN( @fromLatitude / 57.2958 ) * > > > SIN(@toLatitude > > > / 57.2958 ) ) + > > > > ( COS ( @fromLatitude / 57.2958 ) * COS( @toLatitude / 57.2958 ) * > > > COS(@toLongitude > > > /57.2958 - @fromLongitude / 57.2958 ) ) ) ) * 6378.135, 3 ) ) > > > > SELECT @distance; > > > > On 6/26/07, Scott Thornton < [EMAIL PROTECTED]> wrote: > > > > > could it be related to: > > > > >http://www.sql-server-performance.com/faq/sqlviewfaq.aspx?faqid=208 > > > > > but then you mentioned it runs ok on the database itself. > > > > > >>> "Taco Fleur" < [EMAIL PROTECTED]> 26/06/2007 11:57 am >>> > > > > Hello all, > > > > > I am getting the following error "A domain error occurred" > > > > [Macromedia][SQLServer JDBC Driver][SQLServer]A domain error occurred. > > > > > The cfquery tag is calling a stored procedure, and when I call that > > > > procedure directly on the database with the same values there appears > > > to > > > > be > > > > no problem. > > > > > So, I;m guessing it has something to do with the driver? Has anyone > > > seen > > > > this before? > > > > Any help or hints will be much appreciated. > > > > > -- > > > >http://www.clickfind.com.au > > > > The new Australian search engine for businesses, products and services > > > > -- > > > *** { . } { . } > > >http://www.clickfind.com.au > > > The new Australian search engine for businesses, products and services > > > >http://www.clickfind.com.au > > > The new Australian search engine for businesses, products and services > > -- > Cheers > Simon Haddon --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "cfaussie" group. To post to this group, send email to cfaussie@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cfaussie?hl=en -~--~~~~--~~--~--~---