19 #include <grass/gis.h>
20 #include <grass/dbmi.h>
21 #include <grass/glocale.h>
52 for (cl = 0; cl < ncol; cl++) {
107 dbColumn *Col, *NCol;
114 G_warning(_(
"Unable to describe table <%s>"), tname);
122 G_debug(3,
"ncol = %d", ncols);
124 for (i = 0; i < ncols; i++) {
127 NCol = (dbColumn *)
malloc(
sizeof(dbColumn));
132 NCol->sqlDataType = Col->sqlDataType;
133 NCol->hostDataType = Col->hostDataType;
135 NCol->dataLen = Col->dataLen;
136 NCol->precision = Col->precision;
137 NCol->scale = Col->scale;
138 NCol->nullAllowed = Col->nullAllowed;
139 NCol->hasDefaultValue = Col->hasDefaultValue;
140 NCol->useDefaultValue = Col->useDefaultValue;
142 NCol->select = Col->select;
143 NCol->update = Col->update;
dbColumn * db_get_table_column(dbTable *table, int n)
returns column structure for given table and column number
int G_strcasecmp(const char *x, const char *y)
String compare ignoring case (upper or lower)
const char * db_get_column_description(dbColumn *column)
returns column description for given column
int db_column_Ctype(dbDriver *driver, const char *tab, const char *col)
Get column ctype.
const char * db_get_column_name(dbColumn *column)
returns column name for given column
int db_describe_table(dbDriver *driver, dbString *name, dbTable **table)
Describe table.
void db_init_column(dbColumn *column)
int db_column_sqltype(dbDriver *driver, const char *tab, const char *col)
Get column sqltype.
int db_sqltype_to_Ctype(int sqltype)
int db_get_column_sqltype(dbColumn *column)
returns column sqltype for column (the function db_sqltype_name() returns sqltype description) ...
int db_get_table_number_of_columns(dbTable *table)
int db_get_column(dbDriver *Driver, const char *tname, const char *cname, dbColumn **Column)
Get column structure by table and column name.
G_warning("category support for [%s] in mapset [%s] %s", name, mapset, type)
void db_free_table(dbTable *table)
int G_debug(int level, const char *msg,...)
Print debugging message.
int db_set_string(dbString *x, const char *s)
void db_free_string(dbString *x)
void db_init_string(dbString *x)
void db_copy_value(dbValue *dst, dbValue *src)