sqlCtype.c

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

Generated on Sat Oct 24 03:24:24 2009 for GRASS Programmer's Manual by  doxygen 1.6.1