GRASS Programmer's Manual
6.4.3(2013)-r
Main Page
Related Pages
Namespaces
Data Structures
Files
File List
Globals
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Macros
Pages
sqlCtype.c
Go to the documentation of this file.
1
#include <grass/dbmi.h>
2
9
int
db_sqltype_to_Ctype
(
int
sqltype)
10
{
11
switch
(sqltype) {
12
case
DB_SQL_TYPE_INTEGER:
13
return
DB_C_TYPE_INT;
14
case
DB_SQL_TYPE_SMALLINT:
15
return
DB_C_TYPE_INT;
16
case
DB_SQL_TYPE_REAL:
17
return
DB_C_TYPE_DOUBLE;
18
case
DB_SQL_TYPE_DOUBLE_PRECISION:
19
return
DB_C_TYPE_DOUBLE;
20
case
DB_SQL_TYPE_SERIAL:
21
return
DB_C_TYPE_INT;
22
}
23
24
switch
(sqltype & ~DB_DATETIME_MASK) {
25
case
DB_SQL_TYPE_DATE:
26
case
DB_SQL_TYPE_TIME:
27
case
DB_SQL_TYPE_TIMESTAMP:
28
case
DB_SQL_TYPE_INTERVAL:
29
return
DB_C_TYPE_DATETIME;
30
}
31
32
return
DB_C_TYPE_STRING;
33
}
lib
db
dbmi_base
sqlCtype.c
Generated on Thu Sep 26 2013 09:48:06 for GRASS Programmer's Manual by
1.8.4