dbTalk Databases Forums  

Count( ) function

mailing.database.mysql-plusplus mailing.database.mysql-plusplus


Discuss Count( ) function in the mailing.database.mysql-plusplus forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Nicolas Barrera
 
Posts: n/a

Default Count( ) function - 04-25-2005 , 09:47 AM






hi i m having the following problem...
i 'm starting a query with the count(*) function....
like: select aFieldName, count(*) as cant ........ ;

the thing is that i m doing a type check when i got the Result object...

with, result.types(j).base_type() =3D=3D typeid(std::string)=20
and with resultado.types(j).base_type() =3D=3D typeid(int)

both are arguments of two separated if statements...
my problem is that ONLY WHEN executing the query with the COUNT function...=
=20
i DO GET the value BUT it does NOT enter to neither of both if statements..=
..=20

which type is the value returned in the cant alias?? (or better to
say.. by the count(*) function?)

i hope you can give me a hint on this... i need to validate that types
so i m stucked there...
cheers and thanks in advance

--
MySQL++ Mailing List
For list archives: http://lists.mysql.com/plusplus
To unsubscribe: http://lists.mysql.com/plusplus?unsu...ie.nctu.edu.tw


Reply With Quote
  #2  
Old   
Chris Frey
 
Posts: n/a

Default Re: Count( ) function - 04-25-2005 , 02:31 PM






On Mon, Apr 25, 2005 at 11:45:49AM -0300, Nicolas Barrera wrote:
Quote:
hi i m having the following problem...
i 'm starting a query with the count(*) function....
like: select aFieldName, count(*) as cant ........ ;

the thing is that i m doing a type check when i got the Result object...

with, result.types(j).base_type() == typeid(std::string)
and with resultado.types(j).base_type() == typeid(int)
You could try printing the base_type to see what it is.

- Chris


--
MySQL++ Mailing List
For list archives: http://lists.mysql.com/plusplus
To unsubscribe: http://lists.mysql.com/plusplus?unsu...ie.nctu.edu.tw



Reply With Quote
  #3  
Old   
Chris Frey
 
Posts: n/a

Default Re: Count( ) function - 05-02-2005 , 11:44 PM



Hi Nicolas,

You emailed this a while ago, but I've been playing around with the type
info classes in mysql++... don't have any insights on your problem yet,
but what version of mysql C API (not mysql++) are you running?

(please reply to the list)

Thanks,
- Chris


On Mon, Apr 25, 2005 at 05:09:54PM -0300, Nicolas Barrera wrote:
Quote:
i ve already done it.. base_type().name() under the %s format brings
me up a beautiful "x"!!!

On 4/25/05, Chris Frey <cdfrey (AT) netdirect (DOT) ca> wrote:
On Mon, Apr 25, 2005 at 11:45:49AM -0300, Nicolas Barrera wrote:
hi i m having the following problem...
i 'm starting a query with the count(*) function....
like: select aFieldName, count(*) as cant ........ ;

the thing is that i m doing a type check when i got the Result object...

with, result.types(j).base_type() == typeid(std::string)
and with resultado.types(j).base_type() == typeid(int)

You could try printing the base_type to see what it is.

- Chris


--
MySQL++ Mailing List
For list archives: http://lists.mysql.com/plusplus
To unsubscribe: http://lists.mysql.com/plusplus?unsu...mail (DOT) com


--
MySQL++ Mailing List
For list archives: http://lists.mysql.com/plusplus
To unsubscribe: http://lists.mysql.com/plusplus?unsu...ie.nctu.edu.tw



Reply With Quote
  #4  
Old   
Nicolas Barrera
 
Posts: n/a

Default Re: Count( ) function - 05-03-2005 , 10:48 AM



On 5/3/05, Chris Frey <cdfrey (AT) netdirect (DOT) ca> wrote:
Quote:
Hi Nicolas,
=20
You emailed this a while ago, but I've been playing around with the type
info classes in mysql++... don't have any insights on your problem yet,
but what version of mysql C API (not mysql++) are you running?
I don't get it.., the C api for mysql isn't MYSQL++??
anyway... i 'm using.. mysql version 4.0.20, libsqlplus 1.0.7, mysql++ 1.7.=
32

Quote:
(please reply to the list)
sorry..., i pressed reply in gmail.., won't happen again
=20
Quote:
Thanks,
- Chris
thanks to you!

--
MySQL++ Mailing List
For list archives: http://lists.mysql.com/plusplus
To unsubscribe: http://lists.mysql.com/plusplus?unsu...ie.nctu.edu.tw



Reply With Quote
  #5  
Old   
Earl Miles
 
Posts: n/a

Default Re: Count( ) function - 05-03-2005 , 10:52 AM



Nicolas Barrera wrote:
Quote:
I don't get it.., the C api for mysql isn't MYSQL++??
anyway... i 'm using.. mysql version 4.0.20, libsqlplus 1.0.7, mysql++ 1.7.32
No, MySQL++ is only a wrapper around the C API; everything mysql++ does is
basically just a lot of convenience to make the C++ programmer's life easier.

--
MySQL++ Mailing List
For list archives: http://lists.mysql.com/plusplus
To unsubscribe: http://lists.mysql.com/plusplus?unsu...ie.nctu.edu.tw



Reply With Quote
  #6  
Old   
Nicolas Barrera
 
Posts: n/a

Default Re: Count( ) function - 05-03-2005 , 10:58 AM



On 5/3/05, Earl Miles <merlin (AT) logrus (DOT) com> wrote:
Quote:
Nicolas Barrera wrote:
I don't get it.., the C api for mysql isn't MYSQL++??
anyway... i 'm using.. mysql version 4.0.20, libsqlplus 1.0.7, mysql++ =
1.7.32
=20
No, MySQL++ is only a wrapper around the C API; everything mysql++ does i=
s
basically just a lot of convenience to make the C++ programmer's life eas=
ier.
=20
ok sorry i m not awared of that... :S , i ve just joined this project
and i got not much information of all that..., so.. where could i
check the real mysql api ?

thanks...

--
MySQL++ Mailing List
For list archives: http://lists.mysql.com/plusplus
To unsubscribe: http://lists.mysql.com/plusplus?unsu...ie.nctu.edu.tw



Reply With Quote
  #7  
Old   
Warren Young
 
Posts: n/a

Default Re: Count( ) function - 05-03-2005 , 05:36 PM



Nicolas Barrera wrote:

Quote:
where could i check the real mysql api ?
You've already answered the question...it's the same as your MySQL
version number. (Oh, I suppose the API has a different internal version
number, but the MySQL version number suffices.)

--
MySQL++ Mailing List
For list archives: http://lists.mysql.com/plusplus
To unsubscribe: http://lists.mysql.com/plusplus?unsu...ie.nctu.edu.tw



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.