Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ SQL » Sql Avg delivers String instead of double
Sql Avg delivers String instead of double [message #43439] Wed, 30 July 2014 23:38 Go to previous message
masu is currently offline  masu
Messages: 378
Registered: February 2006
Senior Member
Hi,

I noticed in one of my programs that with MySql the Avg() function on a field delivers a String type and not a double type result in response Value.

Here is the sql query I use:

SQL *	Select(	field1,
			Avg(field2), Count(field2),
			Avg(field3), Count(field3))
		.From(table1);


The DB schema is defined in a .sch file and all fields have sql type INT.
Surprisingly Count() in SQL[2] and SQL[4] delivers an expected numeric type (double) in this case which is converted to int automatically when using Value.

But I get a String in SQL[1] and SQL[3] which should also contain double type Value.

What is the reason for it to have String type instead of double?
Can somebody point me to the code location where SQL[] Value are assigned from DB response?

Regards
Matthias


931b81e7ea53320dccc37375b34b38c3
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Bugfix: MySqlConnection::GetRowsProcessed() returns correct value after an sql update
Next Topic: MySql bitwise and
Goto Forum:
  


Current Time: Thu May 02 23:28:27 CEST 2024

Total time taken to generate the page: 0.04716 seconds