Hello,

This is a short question.

What are the methods to differentiate a char or int from a query?

Like: SELECT the_int, the_char .....

I can use:

column_number = 2;

dbitype = dbi_result_get_field_type_idx(result,column_number);
dbitype_attrb = dbi_result_get_field_attribs_idx(result,column_number);

switch (dbitype) {
      case DBI_TYPE_INTEGER: <-------------------- int and char are integer
         if(dbitype_attrb == DBI_INTEGER_SIZE1) {
           // I have char
           break;
         } else if(dbitype_attrb == DBI_INTEGER_SIZE2) {
           // I have short
         } else if(dbitype_attrb == DBI_INTEGER_SIZE4) {
           // I have int
         } else if(dbitype_attrb == DBI_INTEGER_SIZE8) {
           // I have long long
         } else {
           // Nothing
         }

....

Thanks


-- 
-----------------------------------------------------------
João Henrique Freitas - joaohf_at_gmail.com
Campinas-SP-Brasil
BSD051283
LPI 1
http://www.joaohfreitas.eti.br
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
libdbi-users mailing list
libdbi-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libdbi-users

Reply via email to