sqlCtype.c

Go to the documentation of this file.
00001 #include <grass/dbmi.h>
00002 
00009 db_sqltype_to_Ctype (int sqltype)
00010 
00011 {       
00012     switch (sqltype)
00013     {
00014     case DB_SQL_TYPE_INTEGER:          return DB_C_TYPE_INT;
00015     case DB_SQL_TYPE_SMALLINT:         return DB_C_TYPE_INT;
00016     case DB_SQL_TYPE_REAL:             return DB_C_TYPE_DOUBLE;
00017     case DB_SQL_TYPE_DOUBLE_PRECISION: return DB_C_TYPE_DOUBLE;
00018     case DB_SQL_TYPE_SERIAL:           return DB_C_TYPE_INT;
00019     }
00020 
00021     switch (sqltype & ~DB_DATETIME_MASK)
00022     {
00023     case DB_SQL_TYPE_DATE:
00024     case DB_SQL_TYPE_TIME:
00025     case DB_SQL_TYPE_TIMESTAMP:
00026     case DB_SQL_TYPE_INTERVAL:         return DB_C_TYPE_DATETIME;
00027     }
00028 
00029     return DB_C_TYPE_STRING;
00030 }

Generated on Sun Apr 6 17:31:38 2008 for GRASS by  doxygen 1.5.5